Which of the following is correct order of increasing time complexity of…
2026
Which of the following is correct order of increasing time complexity of algorithms:
A. Tower of Hanoi with n disk.
B. Binary search given n sorted numbers.
C. Heap sort given n numbers at the worst case.
D. Addition of two n x n matrices.
Choose the correct answer from the options given below:
B, C, D, A
A, B, C, D
D, C, B, A
C, A, D, B
- A.
1
- B.
2
- C.
3
- D.
4
Attempted by 120 students.
Show answer & explanation
Correct answer: A
To determine the correct order, we analyze the time complexity of each algorithm provided in the question.
A. Tower of Hanoi: O(2^n). B. Binary search: O(log n). C. Heap sort: O(n log n). D. Matrix addition: O(n^2).
Ordering from smallest to largest: O(log n) < O(n log n) < O(n^2) < O(2^n). Thus, the sequence is B, C, D, A.