> For the complete documentation index, see [llms.txt](https://emory.gitbook.io/dsa-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emory.gitbook.io/dsa-java/sorting-algorithms/exercises.md).

# 3.5. Quiz

## Coding

### Shell Sort: Hibbard

* Create the [`ShellSortQuiz`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/comparison/ShellSortQuiz.java) class under the [`sort.comparison`](https://github.com/emory-courses/dsa-java/tree/master/src/main/java/edu/emory/cs/sort/comparison) package that inherits [`ShellSort`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/comparison/ShellSort.java).
* Override the `populateSequence()` and `getSequenceStartIndex()` methods such that it performs Shell Sort by using the Hibbard sequence: $$2^k - 1 \Rightarrow {1, 3, 7, 15, \ldots }$$.
* Feel free to use the code in [`ShellSortKnuth`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/comparison/ShellSortKnuth.java).

### Radix Sort: MSD

* Create the [`RadixSortQuiz`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/distribution/RadixSortQuiz.java) class under the [`sort.distribution`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/distribution/) package that inherits [`RadixSort`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/distribution/RadixSort.java).
* 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`](https://github.com/emory-courses/dsa-java/tree/master/src/main/java/edu/emory/cs/sort/distribution).

## Testing

* Create the [`SortQuizTest`](https://github.com/emory-courses/dsa-java/blob/master/src/test/java/edu/emory/cs/sort/SortQuizTest.java) class under the test [`sort`](https://github.com/emory-courses/dsa-java/blob/master/src/test/java/edu/emory/cs/sort/) package.
* Test the correctness of your `TernaryHeapQuiz` using the [`testRobustness()`](https://github.com/emory-courses/dsa-java/blob/master/src/test/java/edu/emory/cs/sort/SortQuizTest.java#L26) method.
* Add more tests for a more thorough assessment if necessary.

## Benchmarking

* Compare runtime speeds between `ShellSortKnuth` and `ShellSortQuiz` for random, ascending, and descending cases using the [`testRuntime()`](https://github.com/emory-courses/dsa-java/blob/master/src/test/java/edu/emory/cs/sort/SortQuizTest.java#L31) method.
* Compare runtime speeds between `LSDRadixSort` and `RadixSortQuiz` for random cases.
* 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`.

## Submission

* Push everything under the sort package to your GitHub repository:
  * Main: [src/main/java/edu/emory/cs/sort](https://github.com/emory-courses/dsa-java/tree/master/src/main/java/edu/emory/cs/sort)
  * Test: [src/test/java/edu/emory/cs/sort](https://github.com/emory-courses/dsa-java/tree/master/src/test/java/edu/emory/cs/sort)
* Submit **quiz3.pdf** to Canvas.
