Sorting
Q41.
Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?Q42.
Which one of the following in place sorting algorithms needs the minimum number of swaps?Q43.
The number of elements that can be sorted in \Theta (log n) time using heap sort isQ44.
If one uses straight two-way merge sort algorithm to sort the following elements in ascending order: 20, 47, 15, 8, 9, 4, 40, 30, 12, 17 then the order of these elements after second pass of the algorithm is:Q45.
How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order?Q47.
Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort ?