In a heap sort of elements, how many calls are made to in total (including both the build phase and the sort phase)?
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
In a heap sort of elements, how many calls are made to in total (including both the build phase and the sort phase)?
Select one or more correct options. Which of the following are valid collision resolution techniques in hashing?
Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap?
Consider a hash table of size m = 13 using the division method h(k) = k mod 13. Keys 18, 41, 22, 44, 59, 32, 31, 73 are inserted using chaining. How many collisions occur during all insertions?
Merge sort on a linked list of elements has which of the following time and space complexities?
Which of the following statements about the multiplication method of hashing h(k) = floor(m × (k × A mod 1)) are TRUE, where 0 < A < 1?
Consider a min-heap built from the array . After calling , what is the element at the root?
If quick sort always partitions the array in the ratio (one part has elements and the other has elements), what is the time complexity?
The number of comparisons required to merge two sorted arrays of equal size each into a single sorted array of elements is at most:
A hash table of size m = 11 uses linear probing. The hash function is h(k) = k mod 11. After inserting keys 10, 22, 31, 4, 15, 28, 17, 88, 59, what is the average number of probes required for a successful search?
In a min-heap with elements, the minimum element can always be found in time. What is the time complexity of deleting the minimum element and restoring the heap property?
Consider the process of inserting elements one by one into an initially empty min-heap. What is the resulting min-heap array (1-indexed) after all insertions?
What is the worst-case time complexity of quick sort on an array of elements?
Best hashing method against adversary collisions?
A hash table initially has m = 8 slots. When the load factor exceeds 0.75, the table is resized to 2m slots and all keys are rehashed. If 12 keys are to be inserted one by one starting from an empty table, how many total rehashing operations (complete table rebuilds) occur?
Consider the recurrence describing the best-case number of comparisons for merge sort (when each merge step needs only comparisons). What is the asymptotic solution?
The number of swaps performed by quick sort (Lomuto partition) on the array (already sorted ascending) with the last element as pivot at each recursive step is:
A max-heap is a complete binary tree in which the value at every node is greater than or equal to the values of its children. What is the maximum number of nodes in a max-heap of height ?
What is the time complexity of Merge Sort in the worst-case scenario?
Consider a max-heap of distinct elements. What is the minimum number of comparisons needed to find the second largest element?
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 →