When the input is a list of n integers that are in strictly decreasing order (that is, no equal elements), to sort them in increasing order Insertion Sort makes a total of: (a) n - 1 comparisons (b) 2n 1 comparisons (c) n(n-1)/2 comparisons (d) none of the above

Question
When the input is a list of n integers that are in strictly decreasing order (that is, no equal elements),
to sort them in increasing order InsertionSort makes a total of:
(a) n − 1 comparisons
(b) 2n-1 comparisons
(c) n(n − 1)/2 comparisons
(d) none of the above
Transcribed Image Text:When the input is a list of n integers that are in strictly decreasing order (that is, no equal elements), to sort them in increasing order InsertionSort makes a total of: (a) n − 1 comparisons (b) 2n-1 comparisons (c) n(n − 1)/2 comparisons (d) none of the above
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer