MCQ · 1 mark · Algorithm Analysis

GATE CS 2017 CS-2 — Q3

Match the algorithms with their time complexities:
AlgorithmTime complexity
(P) Towers of Hanoi with nn disks(i) Θ(n2)\Theta(n^2)
(Q) Binary search given nn sorted numbers(ii) Θ(nlog⁡n)\Theta(n \log n)
(R) Heap sort given nn numbers at the worst case(iii) Θ(2n)\Theta(2^n)
(S) Addition of two n×nn \times n matrices(iv) Θ(log⁡n)\Theta(\log n)
Select one option