Lab 7 - Sorting

There is no coding for this lab. Answer the following questions. You can send me an email with your answers or turn in a hand-written answer during lab.
  1. (6 points) Sort the array 59, 24, 10, 45, 78, 32, 29, 63, 82, 95 using the following algorithms. Show all work as specified by each algorithm.
    1. Selection sort. Show each pass (where slot i is replaced with the minimum of slots i through n).
    2. Bubble sort. Show each swap of neighbors when they occur during a pass.
    3. Insertion sort. Show each pass (where a hole is opened up in elements 1 through p-1 to insert the p-th element).
  2. (4 points) Give the pseudocode for a modified insertion sort that sorts an index table instead of the actual list. The insertion sort will be passed the index table, the list to be sorted and the number of elements in the list. At the end of this modified insertion sort, the index table will reflect the sorted order of the list and the list will NOT be modified.