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:

  1. B, C, D, A

  2. A, B, C, D

  3. D, C, B, A

  4. C, A, D, B

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. 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.

Explore the full course: Coding For Placement