GATE CSE 2017 Session 2 Q13: Match Hanoi, binary search, heap sort, matrix addition to complexities
- Algorithms
- 1 mark
- MCQ
- −1/3 if wrong
Syllabus topic: Asymptotic worst-case time and space complexity
Question
Match the algorithms with their time complexities:
| Algorithm | Time complexity |
|---|---|
| (P) Towers of Hanoi with disks | (i) |
| (Q) Binary search given sorted numbers | (ii) |
| (R) Heap sort given numbers at the worst case | (iii) |
| (S) Addition of two matrices | (iv) |
Try it: multiple choice: exactly one correct option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation
Answer: C (official GATE 2017 final answer key)
Concept used: Standard running times: Towers of Hanoi needs moves, binary search halves the range, heap sort is , and adding matrices touches entries.
First step: Write the recurrence or operation count for each algorithm, e.g. for Towers of Hanoi.
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 Asymptotic worst-case time and space complexity
Every PYQ on this topic →Share this question
Source: official GATE 2017 Session 2 CS question paper and final answer key, organised by IIT Roorkee. 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