Match List I with List II
| List I | List II |
|---|---|
| A. Insertion Sort | I. O(log n) |
| B. Binary Search | II. O(n²) |
| C. Quick Sort | III. O(n) |
| D. Selection Sort | IV. O(n log n) |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. A-III, B-I, C-IV, D-II
Explanation
Insertion sort runs in O(n) in the best case (A-III). Binary search is O(log n) (B-I). Quick sort averages O(n log n) (C-IV). Selection sort is always O(n²) (D-II).More Data Structures and Algorithms questions
- Arrange the following recurrence relations in increasing order of their time complexity: (A) T(n) = T(n/2) + 1 (B) T(n) = 2T(n/2) + n (C) T…
- Select the sorting algorithms that are stable. (A) Quick Sort (B) Bubble Sort (C) Insertion Sort (D) Merge Sort (E) Shell Sort Choose the c…
- ______ is a self-balancing binary search tree where the path from the root to the farthest leaf is no more than twice as long as the path f…
- Match List I with List IIList I List II (A) Dijkstra's Algorithm (I) Finds the shortest path between all pairs of vertices in a graph with…
- Arrange the following steps in the correct order to solve the Knapsack problem using Dynamic Programming. (A) Define the base case when the…
- Match List I (Recurrence Relation) with List II (Complexity)List I List II (A) T(n) = 2T(n/2) + n (I) T(n) = Θ(n log n) {exact solution} (B…