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?
GateOverflow

Q42.

Which one of the following in place sorting algorithms needs the minimum number of swaps?
GateOverflow

Q43.

The number of elements that can be sorted in \Theta (log n) time using heap sort is
GateOverflow

Q44.

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:
GateOverflow

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?
GateOverflow

Q46.

Which of the following algorithm design technique is used in merge sort?
GateOverflow

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 ?
GateOverflow