Java数据结构代写|CSE 12 PA4

本次作业是一个Java数据结构代写相关的assignment

Part 1: Simulation

Overview

  • lib-1.0-prod.jar

MysteryClassA

MysteryClassB

MysteryClassC

  • Run simulations and classify the type of data structure each of the

mystery classes has implemented

Data Structures

  • ArrayList
  • LinkedList
  • HashTable

Operations

  • find: find the given element
  • remove: remove the given element
  • add: add the element

ArrayList and LinkedList: add to the beginning of the list

Hashtable: add according to the hashing rule

Running the simulation

$ java -jar lib-1.0-prod.jar [class] [operation]

[capacity] [num of iterations] [num of trials]

  • class: A, B, or C
  • operation: add, find or remove
  • capacity: capacity for the data structure
  • num of iterations: number of times the given operation is run in one trial
  • num of trials: number of trials the operation is tested

Example run

  • Run the add method for MysteryClassA. The object is initialized with

capacity 10 and one trial calls add 1000 times. This process is repeated 3

times.

java -jar lib-1.0-prod.jar A add 10 1000 3

Collecting data

chart1

Graphing the data

  • Use the provided Google sheet
  • Example is not actual data

from simulations