$ cd $ cd cs21/inclass $ pwd /home/your_user_name/cs21/inclass $ mkdir w09-sort $ cd w09-sort $ pwd /home/your_user_name/cs21/inclass/w09-sort $ cp ~adanner/public/cs21/w09-sort/* . $ ls sorting.py
Review the function swap(ls, i, j) that swaps the items in positions i and j in the list ls. We will use this function to implement selectSort(ls).
Next, we will implement the key selectSort steps outline in the code. Try testing the code and making sure the list is sorting.
How many steps does this take? How much longer would selection sort take if we doubled the size of the list? Try varying the value of n in main. n=500,1000,2000,4000,8000 make good test values. Do the runtimes follow your intuition?