Fill in the Blanks: Dijkstra’s algorithm builds a _____ Tree.
Shortest Path
Dijkstra’s Algorithm follows which algorithm design paradigm?
A. Divide and Conquer
B. Greedy Method
C. Backtracking
D. Dynamic Programming
B. Greedy Method
What is the standard time complexity of Dijkstra’s algorithm using a Min-Heap (Priority Queue)?
A. O(V + E)
B. O(E log V)
C. O(V²)
D. O(log V)
B. O(E log V)
Fill in the Blanks: _____ is the step where d[v]is improved using d[u].
Relaxation
Fill in the Blanks: _____ is weight < 0 that causes standard Dijkstra to fail.
Negative Edge
Fill in the Blanks: _____ is the efficient greedy algorithm for non-negative weights Dijkstra’s Algorithm
Dijkstra’s Algorithm
Fill in the Blanks: _____ is the data structure optimizing the “extract-min” operation Priority Queue
Priority Queue
Fill in the Blanks: _____ is the algorithm that handles negative weights (but not negative cycles) Bellman-Ford Algorithm
Bellman-Ford Algorithm
True or False: Dijkstra’s algorithm can be used to find the shortest path from all sources to all destinations simultaneously.
TRUE
Fill in the Blanks: In Dijkstra’s algorithm, the operation of updating the distance of a neighbor is called _____.
Relaxation
What happens if we run Dijkstra’s algorithm on a graph with a negative cycle?
A. It will detect and remove the cycle
B. It automatically switches to Bellman-Ford
C. It will still produce correct shortest paths
D. It may enter an infinite loop or give incorrect results
D. It may enter an infinite loop or give incorrect results
Fill in the Blanks: The initial distance to the source vertex in Dijkstra’s algorithm is set to _____.
FALSE
If we use a simple array instead of a heap for Dijkstra’s, the time complexity becomes:
A. O(V²)
B. O(V log V)
C. O(E log V)
D. O(E + V)
A. O(V²)
Dijkstra’s algorithm fails if the graph contains:
A. Zero-weight edges
B. Positive cycles
C. Negative-weight edges
D. Disconnected components
C. Negative-weight edges
Fill in the Blanks: The process of picking the vertex with the smallest distance is an example of a _____ choice.
greedy
True or False: Dijkstra’s algorithm works on both directed and undirected graphs.
TRUE
Which data structure is most efficient for finding the vertex with the minimum tentative distance in Dijkstra’s?
A. Stack
B. Queue
C. Priority Queue (Min-Heap)
D. Linked List
C. Priority Queue (Min-Heap)
True or False: Dijkstra’s algorithm can be used to find the shortest path from all sources to all destinations simultaneously.
FALSE
Fill in the Blanks: The initial distance to all other vertices (except source) is set to _____.
infinity
If d[u] = 10, weight(u, v) = 5 and d[v] = 20, what will be the new value of d[v] after relaxation?
A. 25
B. 10
C. 5
D. 15
D. 15