3.5. Quiz
Quiz 3: Sorting Algorithms
Coding
Shell Sort: Hibbard
Create the
ShellSortQuiz
class under thesort.comparison
package that inheritsShellSort
.Override the
populateSequence()
andgetSequenceStartIndex()
methods such that it performs Shell Sort by using the Hibbard sequence: .Feel free to use the code in
ShellSortKnuth
.
Radix Sort: MSD
Create the
RadixSortQuiz
class under thesort.distribution
package that inheritsRadixSort
.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
sort.distribution
.
Testing
Create the
SortQuizTest
class under the testsort
package.Test the correctness of your
TernaryHeapQuiz
using thetestRobustness()
method.Add more tests for a more thorough assessment if necessary.
Benchmarking
Compare runtime speeds between
ShellSortKnuth
andShellSortQuiz
for random, ascending, and descending cases using thetestRuntime()
method.Compare runtime speeds between
LSDRadixSort
andRadixSortQuiz
for random cases.Create a PDF file quiz3.pdf and write a report that includes charts and explanations to compare runtime speeds between:
ShellSortKnuth
andShellSortQuiz
.LSDRadixSort
andRadixSortQuiz
.
Submission
Push everything under the sort package to your GitHub repository:
Submit quiz3.pdf to Canvas.
Last updated