Question:

Match LIST-I with LIST-II

\[\begin{array}{|c|c|}\hline \textbf{LIST-I (Asymptotic Time Complexity)} & \textbf{LIST-II (Algorithm)} \\ \hline \text{A. Logarithmic  \(O(\log n)\)} & \text{II. Finding an element in a sorted array} \\ \hline \text{B. Quadratic  \(O(n^{2})\)} & \text{III. Bubble sort (worst case)} \\ \hline \text{C. Cubic \(O(n^{3})\)} & \text{IV. Matrix Multiplication} \\ \hline \text{D. Exponential  \(O(2^{n})\)} & \text{I. The Tower of Hanoi problem} \\ \hline \end{array}\]
 

Choose the correct answer from the options given below:

Show Hint

Time complexity plays a critical role in evaluating the efficiency of algorithms. Understanding the time complexities of various algorithms helps optimize program performance.
Updated On: Sep 25, 2025
  • A - I, B - II, C - III, D - IV
  • A - II, B - III, C - IV, D - I
  • A - I, B - II, C - IV, D - III
  • A - III, B - I, C - D, I - II
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Match the time complexities with algorithms. 
- **A. Logarithmic (O(lg n))**: The Tower of Hanoi problem has a time complexity of \(O(lg n)\). 

- **B. Quadratic (O(n²))**: Finding an element in a sorted array has a time complexity of \(O(n²)\), which is related to algorithms like bubble sort or insertion sort. 

- **C. Cubic (O(n³))**: Bubble sort in the worst case has a time complexity of \(O(n³)\). 

- **D. Exponential (O(2^n))**: Matrix multiplication has an exponential time complexity of \(O(2^n)\).

Step 2: Conclusion. 
Thus, the correct matching is: 

- A - I: Logarithmic time complexity is associated with the Tower of Hanoi problem. 

- B - II: Quadratic time complexity is associated with finding an element in a sorted array. 

- C - III: Cubic time complexity is associated with Bubble sort in the worst case. 

- D - IV: Exponential time complexity is associated with Matrix Multiplication. 

The correct answer is option (1).

Was this answer helpful?
0
0