arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

3.5. Quiz

Quiz 3: Sorting Algorithms

hashtag
Coding

hashtag
Shell Sort: Hibbard

  • Create the class under the package that inherits .

  • Override the populateSequence() and getSequenceStartIndex() methods such that it performs Shell Sort by using the Hibbard sequence: .

  • Feel free to use the code in .

hashtag
Radix Sort: MSD

  • Create the class under the package that inherits .

  • Override the sort() method such that it performs Radix Sort from the most significant digit (MSD) to the least significant digit (LSD).

  • Feel free to use the code in

hashtag
Testing

  • Create the class under the test package.

  • Test the correctness of your TernaryHeapQuiz using the method.

  • Add more tests for a more thorough assessment if necessary.

hashtag
Benchmarking

  • Compare runtime speeds between ShellSortKnuth and ShellSortQuiz for random, ascending, and descending cases using the method.

  • Compare runtime speeds between LSDRadixSort and RadixSortQuiz for random cases.

hashtag
Submission

  • Push everything under the sort package to your GitHub repository:

    • Main:

    • Test:

.

Create a PDF file quiz3.pdf and write a report that includes charts and explanations to compare runtime speeds between:

  • ShellSortKnuth and ShellSortQuiz.

  • LSDRadixSort and RadixSortQuiz.

Submit quiz3.pdf to Canvas.

2k−1⇒{1,3,7,15,…}2^k - 1 \Rightarrow \{1, 3, 7, 15, \ldots \}2k−1⇒{1,3,7,15,…}
ShellSortQuizarrow-up-right
sort.comparisonarrow-up-right
ShellSortarrow-up-right
ShellSortKnutharrow-up-right
RadixSortQuizarrow-up-right
sort.distributionarrow-up-right
RadixSortarrow-up-right
SortQuizTestarrow-up-right
sortarrow-up-right
testRobustness()arrow-up-right
testRuntime()arrow-up-right
src/main/java/edu/emory/cs/sortarrow-up-right
src/test/java/edu/emory/cs/sortarrow-up-right
sort.distributionarrow-up-right