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:
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).
Match List-I with List-II and choose the correct answer:
Match List-I with List-II:
Who said this sentence –
Match List-I with List-II and choose the correct answer: