If algorithm A and another algorithm B take −− log (n) √n 2 and microseconds, respectively, to n solve a problem, then the largest size of a problem these algorithms can solve, respectively, in one second are ___ and _____
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 2^(10⁶) and 10¹²
Explanation
One second is 10⁶ μs. log₂ n = 10⁶ gives n = 2^(10⁶); √n = 10⁶ gives n = 10¹².
More Data Structures and Algorithms questions
- Let be a directed graph whose vertex set is the set of numbers from 1 to 100 . There is an i j edge from a vertex to a vertex if and only i…
- 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 Ω(…
- 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 :