Rules and Starter Code
Rules
- Do not use the Java Collections (
java.util.ArrayList,java.util.HashMap, and so on) in your code. Use theListandArrayListin thelistpackage. - Do not change these files:
List.java,ArrayList.java,Measured.java,SortingAlgorithm.java,NullSort.java,GnomeSort.java,Set.java,ArraySet.java, and the given test files. You may add tests to the given test files. - Do not change the drivers, except where these pages say you may:
SIZEinSortingAlgorithmDriver, and theexperimentQueriesmethod inSetDriver. - Do not change the data files.
- The starter declares private helper methods in some classes, such as
indexOfMaxinSelectionSortandmergeinMergeSort. Implement each one, and use it in your solution. Do not change their names or parameters: the auto-test calls them directly. You may add more private helpers. Do not add public methods.
Starter code
A link to download the starter code, hw1-starter.zip, will be posted on the course discussion board. Download it and unzip it. You get a folder called hw1-sort-and-search. Open this folder in your editor.
The project is set up the same way as the code for each chapter. Run all the tests from the project folder with:
scripts/test.sh
Run the tests of one class with, for example:
scripts/test.sh sorts.BubbleSortTest
Most tests fail at first. That is expected: every method you have to write throws an UnsupportedOperationException until you write it. README.md in the project describes every file.