Selection Sort Exercises

November 10th, 2015

Screen Shot 2014-11-16 at 3.06.54 PM

Go to classroom Salon – Selection Sort Video

Classwork:
1. Show, in the style of the example trace with the given implementation,how selection sort sorts the array E A S Y Q U E S T I O N.

2. What is the maximum number of exchanges involving any particular element during selection sort? What is the average number of exchanges involving an element?

3. Give an example of an array of N items that maximizes the number of times the test a[j] < a[min] fails (and, therefore, min gets updated) during the operation of selection sort (given implementation).