Data in Random Order

Run the following applet using list sizes of 25, 50, 100, 500, and 1000. Record the results between each run.

There are three additional sorts: BubbleSort, Merge Sort, and Heap Sort. Bubble Sort is the same algorithm that is discussed in Chapter 9 but does not have a flag that allows it to stop when the list is already sorted. Heap Sort and Merge Sort are sorting algorithms that have not been discussed in this text.



What looks strange about Merge Sort?

The results from Heap Sort are similiar to which other sort? Explain

Take the results from the five runs and sum the number of swaps and the number of comparisons. Then rank order the seven sorting algorithms on the basis of this total. From these observations, can you break the sorts into two complexity groups: O(N*N) and O(NlogN)? If you are using this exercie before reading Chapter 17, NlogN sorts are faster (better) than N*N sorts.