The number of comparisons performed by merge sort to merge two sorted arrays of sizes and () in the best case is:
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
The number of comparisons performed by merge sort to merge two sorted arrays of sizes and () in the best case is:
Consider the following statements about heap data structure: \begin{itemize} \item[(P)] A max-heap supports in and in \item[(Q)] A heap can be used to sort elements in worst-case time using extra space \item[(R)] In a max-heap, the second largest element is always a child of the root \item[(S)] Heap sort is not adaptive - its running time is even for already-sorted input \end{itemize} Which of the above statements are TRUE?
What is the number of comparisons made by quick sort in the best case on an array of elements, expressed as a recurrence?
Consider a Merge Sort implementation that uses insertion sort for subarrays of size less than a threshold 'k'. What happens to the time complexity if 'k' is set to a very large value?
The total number of comparisons performed by quick sort using Lomuto partition on the array (sorted ascending) with the last element as pivot is:
The number of levels in the recursion tree of merge sort on elements is:
Which of the following are TRUE about heap sort as compared to merge sort and quick sort?
Which of the following are advantages of chaining over open addressing for collision resolution?
Which of the following is NOT a characteristic of a good hash function?
The time complexity of searching for an element in a hash table with chaining (assuming uniform hashing) is:
Consider the following array: . Merge sort divides this into two halves and recursively sorts them. What are the two sorted halves just before the final merge?
Which of the following are TRUE about perfect hashing?
The minimum number of comparisons required to sort distinct elements using merge sort is:
Consider a max-heap with nodes (a complete binary tree of height 3 with all levels full). How many leaf nodes does it contain, and what are their indices in a 1-indexed array?
Given a max-heap of elements stored in array , the procedure is called with . What is the maximum number of recursive calls (or iterations) made by in the worst case?
What is the worst-case time complexity of Merge Sort?
The expected number of comparisons performed by randomized quick sort on an array of distinct elements is approximately:
Consider quick sort applied to the array with the last element as pivot (Lomuto scheme). After one complete partition step, what is the resulting array and the final index of the pivot?
For merge sort, what is the total work done (in terms of comparisons) across all levels of the recursion tree for an array of elements?
In a hash table with open addressing, deletion of a key is more complex than in chaining. Why is simply marking a slot as empty upon deletion incorrect?
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 →