Question 71
HardWhat is the time complexity of Dijkstra's algorithm with a Fibonacci heap?
- A.
O(VE)
- B.
O(E log V)
- C.
O(E + V log V)
- D.
O(V²)
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
What is the time complexity of Dijkstra's algorithm with a Fibonacci heap?
O(VE)
O(E log V)
O(E + V log V)
O(V²)
Sign up free to see the answer and a step-by-step explanation.
What does Tarjan's bridge-finding algorithm compare for each tree edge (u, v)?
Edge weights
Whether low[v] > disc[u]
Whether u and v have the same colour
Whether disc[v] < disc[u]
Sign up free to see the answer and a step-by-step explanation.
How many edges does a complete directed graph (no self-loops) on n vertices have?
n²
2ⁿ
n(n − 1)/2
n(n − 1)
Sign up free to see the answer and a step-by-step explanation.
Which graph problem is NP-hard?
Finding shortest paths with non-negative weights
Finding a minimum spanning tree
Finding a Hamiltonian cycle
Finding an Euler circuit
Sign up free to see the answer and a step-by-step explanation.
When does an undirected connected graph have an Euler circuit?
When every vertex has even degree
When it is a tree
When it has no cycles
When it has an odd number of edges
Sign up free to see the answer and a step-by-step explanation.
A* search is guaranteed to find a shortest path when its heuristic is:
Random
Larger than the true cost
Admissible (never overestimates the remaining cost)
Always zero
Sign up free to see the answer and a step-by-step explanation.
What is the maximum flow equal to, by the max-flow min-cut theorem?
The longest path
The capacity of the minimum cut separating source and sink
The number of edges
The sum of all capacities
Sign up free to see the answer and a step-by-step explanation.
How do you count connected components in an undirected graph in O(V + E)?
Run BFS/DFS from each unvisited vertex and count the runs
Count edges
Sort the edges
Use Floyd–Warshall
Sign up free to see the answer and a step-by-step explanation.
In a DAG with weighted edges, how can you find the longest path efficiently?
It is NP-hard even on DAGs
Process vertices in topological order, relaxing edges to maximise distance
Use Dijkstra with negated weights on any graph
Use BFS
Sign up free to see the answer and a step-by-step explanation.
Which algorithm finds a minimum spanning tree by repeatedly removing the most expensive edge that doesn't disconnect the graph?
Borůvka
Prim
Reverse-delete
Kruskal
Sign up free to see the answer and a step-by-step explanation.