1. insertion sort ----------------- initial array: 7 39 20 11 16 5 39 doesn't need to be inserted: 7 39 20 11 16 5 20 is inserted: 7 20 39 11 16 5 11 is inserted: 7 11 20 39 16 5 16 is inserted: 7 11 16 20 39 5 5 is inserted: 5 7 11 16 20 39 The following tasks will be moved to next week's lab: 2. initial partitioning by quicksort ------------------------------------ initial array: 7 39 20 11 16 5 pivot = 20 move i left to right until we find 39 move j right to left until we find 5 swap: 7 5 20 11 16 39 continuing left to right, find 20 continuing right to left, find 16 swap: 7 5 16 11 20 39 continuing left to right, find 20 in its new location continuing right to left, find 11 i and j have now crossed, so we don't swap. Instead, we return the final value of j (which is 3), which gives the end of the left subarray. The two subarrays are: 7 5 16 11 | 20 39 3. completing the trace of quicksort ------------------------------------ see the separate image file