8. a. –∞or, more generally, any value less than or equal to every element in
the array.
9. Yes, but we will have to scan the sorted part left to right while inserting
[]to get the same (2)efficiency as the array version
10. The efficiency classes of both versions will be the same. The inner loop
of InsertionSort consists of one key assignment and one index decrement;
11. a. The largest number of inversions for [](0≤≤−1) is −1−;
this happens if []is greater than all the elements to the right of it.
Therefore, the largest number of inversions for an entire array happens for
a strictly decreasing array. This largest number is given by the sum:
b. Assuming that all elements are distinct and that inserting []in each
of the +1possible positions among its predecessors is equally likely, we
obtain the following for the expected number of key comparisons on the
th iteration of the algorithm’ssentinelversion:
7