Assignment 10
Time Trials.
Final version: Text as pdf
Final version: Text
as html
Finalized on March 23 at 4:15 pm
Please, replace the TestData.java file with the following: TestData.java
Naming the classes and files
You must use the names given below.
For Assignment 10 the following files were provided.
You should not need to make any changes in them:
- ASortAlgo.java
- ArrSortSelection.java --- does not include a complete test suite, but you can omit that
- CitiesAList.java
- CitiesConsList.java
- CitiesMTList.java
- City.java
- CityView.java
- ComparatorByName.java
- DataSet.java
- ISame.java
- TestData.java
- Traversal.java
- TraversalALC.java
- TraversalCitiesList.java
- TraversalInConsole.java
- TraversalInFile.java
- TraversalInGUI.java
- TraversalOutFile.java
- TraversalTestHarness.java
The following files were provided, but you should make necessary
changes:
- Tests.java
- TimerTests.java
Additionally, you should implement the following classes:
You must use the names given below.
- ABSTsort.java --- binary tree sort
- AListSortInsertion.java --- insertion sort with lists
- AListSortQuickSort.java --- quicksort with lists
- ArrSortQuick.java --- quicksort with ArrayList
- ArrSortInsertion.java --- insertion sort with ArrayList
- BSTLeaf.java --- (if needed - the leaf of a binary search tree)
- BSTNode.java --- (if needed - the node of a binary search tree)
- BSTabstract.java --- (if needed - the abstract binary search tree)
- ComparatorByLongitude.java --- longitude comparator
- ComparatorByZip.java --- zip code comparator
- Result.java --- the result class
You must use the names given above.
Read the code in the provided files. Here is a brief overview of the classes:
- ASortAlgo.java --- an abstract class for sorting algorithms
- ArrSortSelection.java --- extends ASortAlgo: selection sort for ArrayList
- CitiesAList.java, CitiesConsList.java, CitiesMTList.java --- list of cities
- City.java --- same city as in HW9
- CityView.java --- used by the GUI input (not needed otherwise)
- ComparatorByName.java --- an example of comparator - you will need two more
- DataSet.java --- for each timing test the DataSet has the data (saved as ArrayList), knows the size of the data, and whether it has data ordered as it came fromthe source, or randomized
- ISame.java --- same old ISame interface
- TestData.java --- class that generates and saves the DataSet-s for the timing tests -- should read citiesdb,txt file form HW9
- Tests.java --- what used to be Examples class
- TimerTests.java --- Read this carefully this class has an example of how to invoke the specific algorithm with the specific comparator and data set, and record the time needed to sort the data. You will add more algorithms and comparators. For now you can add the code to run the selection sort with all DataSet-s in the TestData class and add two more comparators (by zip code and by latitude -- and improve the 'byName' comparator so it compares by name and city)
- Traversal.java and all the following Traversal... classes provide iterators galore...
- TraversalALC.java
- TraversalCitiesList.java
- TraversalInConsole.java
- TraversalInFile.java
- TraversalInGUI.java
- TraversalOutFile.java
- TraversalTestHarness.java --- the same test harness you were testing last week
Code base HW10.zip
Due Date: Tuesday, March 28, 2006 at 8:00 pm.