The running time of an algorithm is O(g(n)) if and only if:
(A) its worst-case running time is O(g(n)) and its best-case running time is Ω(g(n)).
(B) its worst-case running time is Ω(g(n)) and its best-case running time is O(g(n)).
(C) O(g(n))=Ω(g(n)) (O= big O).
(D) o(g(n))∩ω(g(n)) is non-empty. (o= small o)
Choose the correct answer from the options given below:
(A) (A) only (B) (B) only
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. only
Explanation
The official key takes statement (A) as the defining condition. Statements (C) and (D) are false: O(g) and Ω(g) are different classes, and o(g) ∩ ω(g) is always empty.
More Data Structures and Algorithms questions
- Match List I with List II. List I: A. Topological sort of a DAG, B. Kruskal's MST algorithm, C. Bellman-Ford single-source shortest path, D…
- Consider the undirected graph below: Using Prim's algorithm to construct a minimum spanning tree starting with node a, which one of the fol…
- G T Let be a simple undirected graph, D be a DFS G T tree on , and B be the BFS tree on G. Consider the following statements. G Statement I…
- The weight of minimum spanning tree in graph G, calculated using Kruskal's algorithm is :
- What is the worst case running time of Insert and Extract-min, in an implementation of a priority queue using an unsorted array? Assume tha…
- In a B-Tree, each node represents a disk block. Suppose one block holds 8192 bytes. Each key uses 32 bytes. In a B-tree of order M there ar…