The number of elements that can be sorted in time using heap sort is
GATE CSE · Algorithms
Master topic for Sorting. Includes Merge Sort, Quick Sort, Heap and Heap Sort.
187 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
The number of elements that can be sorted in time using heap sort is
Which of the following sorting algorithms has the minimum running time complexity in the best and average case?
A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
Which of the following algorithm design technique is used in merge sort?
Which one of the following in place sorting algorithms needs the minimum number of swaps?
What is the number of swaps required to sort n elements using selection sort, in the worst case?
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?
If we use Radix Sort to sort n integers in the range , for some k>0 which is independent of n, the time taken would be?
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?
Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the elements. Let T(n) be the number of comparisons required to sort n elements. Then
Which of the following sorting algorithms has the lowest worst-case complexity?
Selection sort algorithm design technique is an example of
The average case and worst case complexities for Merge sort algorithm are
Which one the following in place sorting algorithms needs the minimum number of swaps?
The median of n elements can be found in O(n) time. Which one of the following is correct about the complexity of quick sort, in which median is selected as pivot?
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of
In a permutation of n distinct integers, an inversion is a pair such that and . 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?
The usual 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 will
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 ?
A sorting technique is called stable if
Want unlimited AI-generated Sorting questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →