CS 36CWinter 2024 Homework 3:
SkipList and Sorting
This project has you writing an implementation of a SkipList (to do a key/value data store),
mergesort on linked lists, and quicksort on arrays. This assignment is due on Tuesday February
6th at 1400 PST (6:00 pm Davis time). You must work on this assignment individually. We have
provided you with a rich skeleton project in Homework3.zip available from Canvas which
includes a full Gradle and IntelliJ environment.
This time the Skeleton project actually includes all the tests used for grading, as a sufficient
number of students submitted photos for Cat Break.
Expected Project Outcomes
- Implement the major functionality of a SkipList, including the iterator (which produces
pairs), setting, and getting elements. - Implement mergesort for a LinkedList
- Implement quicksort for arrays
Implementation and Grading
You should implement the specified function in the three Kotlin files. These are: - SkipListCell.makeNextArray(): Array<SkipListCell<K, V>?>
- SkipListIterator.computeNext(): Unit
- SkipList.set(): Unit
- SkipList.getNode(): SkipListCell<K, V>
- SkipList.contains(element: ): Boolean
- LinkedList.split(start: LinkedListCell) :
Pair<LinkedListCell,LinkedListCell> - LinkedList.mergeSortWith(comp: Comparator) : LinkedList
- Array.quickSortWith( comp: Comparator) : Array
For grading on Gradescope you will submit SkipList.ks, LinkedList.ks, and
ArraySorter.ks files.
Wehave provided you with the comprehensive test suite used for grading, but you may add
further tests if you desire and are encouraged to do so.
The SkipList basic operations (insertion, fetching, and checking) should be O(log(n)) and the
two sorts should be O(n log(n)) in all cases (in the case of QuickSort this means no pathological
cases that are O(n2)). The test cases include the performance evaluation necessary.