Match the algorithms with their time complexities:
|
Algorithm
|
|
Time complexity
|
(P)
|
Towers of Hanoi with n disks
|
(i)
|
Θ (n2)
|
(Q)
|
Binary search given n sorted numbers
|
(ii)
|
Θ (n log n)
|
(R)
|
Heap sort given n numbers at the worst case
|
(iii)
|
Θ (2n)
|
(S)
|
Addition of two n × n matrices
|
(iv)
|
Θ (log n)
|
1. P – (iii), Q – (iv), R – (i), S – (ii)
2. P – (iv), Q – (iii), R – (i), S – (ii)
3. P – (iii), Q – (iv), R – (ii), S – (i)
4. P – (iv), Q – (iii), R – (ii), S – (i)