1. Consider the array of integers 10 3 7 1 5.
a. Trace the steps of a selection sort as it sorts this array into ascending order. Write the array contents every time two integers are swapped.
b. How many swaps and how many comparisons did the sort require?
2. Repeat the previous exercise, but instead use an insertion sort.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here