GATE DA 2026 Q15: Expected-time recurrence for randomised-input quicksort
- Programming, Data Structures and Algorithms
- 1 mark
- MCQ
- −1/3 if wrong
Question
Consider that the quick sort algorithm is used to sort an array of distinct randomly ordered elements. In every call, the pivot is chosen as the first element of the current subarray.
Let denote the expected time to sort the array. Assume that the time to partition is linear in the size of the current subarray.
Which of the following recurrence relations correctly represents in this scenario?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2026 final answer key)
Concept used: Expected cost: average over every possible rank of the pivot.
First step: For random input the first element is equally likely to be any rank , giving subproblems of sizes and .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2026 DA question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Programming, Data Structures and Algorithms PYQs
- 2026 · Q16Python mutable default argument output
- 2026 · Q25Binary tree from preorder and inorder traversals
- 2026 · Q31Worst-case comparisons in binary search of 1000 elements
- 2026 · Q39Number of calls made by a Fibonacci-like recursion
- 2026 · Q40Reachability in a graph and its reverse
- 2026 · Q49Comparisons by bubble sort and insertion sort on a nearly sorted array