Algorithm
Q201.
In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case time complexity of the quick sort?Q202.
Which one the following in place sorting algorithms needs the minimum number of swaps?Q205.
The usual \Theta (n^{2}) implementation of Insertion Sort to sort ab array uses linear search to identify the position where an element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position, the worst case running time willQ207.
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot (i). 1, 2, 3, \dots n (ii). n, n-1, n-2, \dots, 2, 1 Let C_1 and C_2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,Q208.
Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?Q209.
Which one of the following in place sorting algorithms needs the minimum number of swaps?Q210.
The number of elements that can be sorted in \Theta (log n) time using heap sort is