CSCI 151 - Data Structures and Object-Oriented Development
Spring 2015
Lab 15: Sorting
- In this lab, we will experiment with sorting algorithms.
- Your task is to implement the following four algorithms:
- Insertion sort
- Heapsort
- Merge sort
- Quicksort
- The provided code includes both timing experiments and an animated visualization.
- The following files are provided in the
sorters package:
- SorterTest: Contains unit tests
for the sorting algorithms. It is designed to test the algorithms in
the order given above. It is recommended that they be implemented
in this order. Feel free to permute the ordering if you wish to try
a different implementation order.
- TimeTest: Performs 1000 tests of
randomized arrays of 10000 integers of heapsort, merge sort, and
quicksort. It gives the 95% confidence interval for the running times,
in milliseconds.
- GnomeSorter: Example sorting algorithm, implemented for you.
- InsertionSorter: Implement insertion sort in this file.
- HeapSorter: Implement heapsort in this file.
- MergeSorter: Implement merge sort in this file.
- QuickSorter: Implement quicksort in this file.
- Additional files are provided in the
application package. Once your sorters are working, run the Sortimator program to see an interesting visualization of each algorithm.
Grading
For an A+, implement all four algorithms. Also, provide the timing information gleaned
from TimeTest via Moodle when submitting.
Without this, the grade is as follows:
| Number of Sorting Algorithms implemented | Grade |
| 4 | A |
| 3 | B |
| 2 | C |
| 1 | D |