The purpose of this assignment is to implement various data structures and algorithms described in class.
Overview One of the most important ADTs is the Dictionary and one of the most studied problems is sorting. In this assignment, you will write multiple implementations of sorting algorithms.
To measure runtime of each sorting algorithm, You must understand when comparisons and movements happen. The time taken by each algorithm will be measured by milliseconds.
It is also able to see differcnes when same size of arrays are in different order.
- Inorder: the array is already sorted in ascending order.
- Reverse order: the array is sorted in descending order.
- Almost order: half of the array is sorted in ascending order and the other half is in random order.
- Random order: the array is not sorted. It is generated by random numbers.
-
Input a number of size of list you wish to sort.
-
After your input, it will show report of run time, the number of movements and comparisons of elements
- insertion sort
- selection sort
- quick sort
- merge sort
- heap sort
- radix sort
-
Each sorting algorithm will sort 4 list properties.
-
Report contains movement, comparison, and total time.
-
It will ask whether you want to test it again or not.
-
Enter 0 to exit or Enter another number of size of list you wish to sort.