# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emory.gitbook.io/dsa-java/sorting-algorithms/exercises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
