Consider the array stored as a 0-indexed array. If this represents a max-heap, which of the following is TRUE?
GATE CSE · Algorithms
Master topic for Sorting. Includes Merge Sort, Quick Sort, Heap and Heap Sort.
187 questions · 0 PYQs · 20 AI practice · GATE CSE 2027
Consider the array stored as a 0-indexed array. If this represents a max-heap, which of the following is TRUE?
What is the average-case time complexity of quick sort on an array of distinct elements, assuming random pivot selection?
Which of the following are correct advantages of merge sort over quick sort?
The number of distinct max-heaps that can be constructed using the set of numbers is:
Which of the following correctly describe open addressing hash collision resolution strategies and their probe sequences?
Consider inserting element into the following max-heap: (1-indexed). What is the resulting heap after insertion?
The following array represents a max-heap (1-indexed): . After deleting the maximum element and restoring the heap property, what is the resulting array?
In a hash table using open addressing with linear probing, what is the expected number of probes for an unsuccessful search when the load factor is α?
The maximum number of recursive calls (stack frames) active simultaneously during quick sort on an array of elements in the best case is:
The space complexity of quick sort in the worst case (due to the recursion stack) is:
Select one or more correct options regarding the merge step in Merge Sort:
Which of the following are TRUE about quick sort compared to merge sort?
Consider randomized quick sort where the pivot is chosen uniformly at random. The probability that the algorithm runs in time is:
Consider quick sort with three-way partitioning (Dutch National Flag) on an array with many duplicate elements. Which of the following are TRUE?
Bottom-up (iterative) merge sort on an array of elements starts by merging subarrays of size 1. How many passes (merge rounds) are required to fully sort the array?
A hash table of size m = 11 uses double hashing with h₁(k) = k mod 11 and h₂(k) = 1 + (k mod 9). Insert keys 10, 22, 31, 4, 15, 28, 17, 88, 59 in order. What is the load factor after all insertions?
A hash table of size 10 uses chaining. Keys 11, 22, 33, 44, 55 are inserted using h(k) = k mod 10. What is the length of the longest chain?
Which of the following correctly compares merge sort with heap sort?
Merge sort is applied to sort sorted arrays each of size . The total time to merge all arrays into one sorted array of size using a -way merge (min-heap based) is:
In the Lomuto partition scheme for quick sort, the pivot is (last element of the subarray ). After partitioning, the pivot ends up at index . Which of the following is always TRUE about the partition?
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 →