Consider the following algorithms and their running times. Which one of the following is correct?
| List I | List II |
|---|---|
| A. Breadth-first search | I. Θ(V + E) |
| B. Rabin–Karp algorithm | II. O(V + E) |
| C. Depth-first search | III. Θ((n − m + 1)m) |
| D. Heap sort (worst case) | IV. O(n²) |
| E. Quick sort (worst case) | V. O(n log n) |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. A-II, B-III, C-I, D-V, E-IV
Explanation
BFS O(V + E); Rabin–Karp worst case Θ((n − m + 1)m); DFS Θ(V + E); heap sort worst O(n log n); quick sort worst O(n2).More Data Structures and Algorithms questions
- Consider the following statements on approximation algorithms: Statement I: APPROX-VERTEX-COVER is a polynomial-time 2-approximation algori…
- Which of the following is used to determine the cost performance index?
- Software project manager is responsible for the following task: (A) Project planning (B) Project status tracking (C) Resources management (…
- Fill in the blanks: "An ________ chart is a project schedule representation that presents the project plan as a directed graph. The critica…
- Which of the following are the primary objectives of risk monitoring in software project tracking? P: To assess whether predicted risks do,…
- Which one of the following is a highly associated activity of project planning? (1) Keep track of the project progress. (2) Compare actual…