Algorithm
Q181.
Consider the following sorting algorithms.I. QuicksortII. HeapsortIII> MergesortWhich of them perform in least time in the worst case?Q182.
Let P be a quick sort program to sort numbers in ascending order using the first element as the pivot. Let t1 and t2 be the number of comparisons made by P for the inputs [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?Q183.
Let P be a quicksort program to sort numbers in ascending order. Let t_{1} and t_{2} be the time taken by the program for the inputs \left[1 \ 2 \ 3 \ 4\right] and \left[5 \ 4 \ 3 \ 2 \ 1\right], respectively. Which of the following holds?Q184.
In a permutation a_1.....a_n of n distinct integers, an inversion is a pair (a_i, a_j) such that i \lt j and a_i \gt a_j. What would be the worst case time complexity of the insertion Sort algorithm, if the inputs are restricted to permutations of 1....n with at most n inversions?Q185.
If we use Radix Sort to sort n integers in the range \left (n^{k/2}, n^k \right ), for some k>0 which is independent of n, the time taken would be?Q187.
Choose the correct alternatives (More than one may be correct).The complexity of comparision based sorting algorithms is:Q188.
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?Q190.
You have an array of n elements. Suppose you implement quick sort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is