GATE CSE 2019 Q47: Worst-case time to find the median of medians of n arrays of size n
- Algorithms
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topics: Algorithm design techniques: greedy, dynamic programming and divide-and-conquer; Asymptotic worst-case time and space complexity
Question
There are unsorted arrays: . Assume that is odd. Each of contains distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing the median of the medians of is
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: C (official GATE 2019 final answer key)
Concept used: The median (any order statistic) of unsorted elements can be found in worst-case time with the linear-time selection algorithm.
First step: Count the cost of finding each array's median with linear-time selection, add up over the arrays, then add the cost of one more selection on the medians.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Algorithm design techniques: greedy, dynamic programming and divide-and-conquer
Every PYQ on this topic →Share this question
Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs