Q. In a case study involving a city map, which application of Dijkstra's algorithm is most relevant?
-
A.
Finding the fastest route between two locations
-
B.
Calculating the total distance of all roads
-
C.
Determining the longest path in the city
-
D.
Finding all intersections in the map
Solution
In a city map scenario, Dijkstra's algorithm is most relevant for finding the fastest route between two locations.
Correct Answer:
A
— Finding the fastest route between two locations
Learn More →
Q. What is the main advantage of using Dijkstra's algorithm over other shortest path algorithms?
-
A.
It can handle negative weights
-
B.
It is simpler to implement
-
C.
It guarantees the shortest path in graphs with non-negative weights
-
D.
It works on directed graphs only
Solution
The main advantage of Dijkstra's algorithm is that it guarantees the shortest path in graphs with non-negative weights.
Correct Answer:
C
— It guarantees the shortest path in graphs with non-negative weights
Learn More →
Q. Which of the following is NOT a limitation of Dijkstra's algorithm?
-
A.
It cannot handle negative weight edges
-
B.
It is not suitable for dense graphs
-
C.
It finds the shortest path from a single source
-
D.
It can be inefficient for large graphs
Solution
Dijkstra's algorithm is designed to find the shortest path from a single source to all other nodes, which is one of its primary functions.
Correct Answer:
C
— It finds the shortest path from a single source
Learn More →
Q. Which of the following scenarios would require the use of an alternative to Dijkstra's algorithm?
-
A.
Finding the shortest path in a road network
-
B.
Calculating the shortest path in a graph with negative weights
-
C.
Finding the shortest path in a weighted graph
-
D.
Finding the shortest path in a tree structure
Solution
If the graph contains negative weight edges, an alternative algorithm like Bellman-Ford should be used instead of Dijkstra's.
Correct Answer:
B
— Calculating the shortest path in a graph with negative weights
Learn More →
Showing 1 to 4 of 4 (1 Pages)