Name: ________________________________

Honor Code Acknowledgment: ___________________


Random Quiz # 5

CPS 100, Fall 1995

Due: October 24


Problem: (6 points)

In a "stable" sort if there are two elements with the same value, they maintain their order after the sort. For example, in the list below, each item below contains a name and an age.
  joe    sue   bob  sue  bob
  18     20    17   13   19
If the items are sorted as below, the sort was stable since the first "sue" in the list below is the first "sue" in the list above. The order of the sue's was maintained.
  bob   bob  joe  sue  sue
  17    19   18   20   13 
For each of the following sorts, label the sort as stable or unstable and explain why.
  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Shellsort
  5. Merge Sort
  6. Quicksort