Q. In which scenario would you prefer using Dijkstra's algorithm over A* search algorithm?
-
A.
When you need to find the shortest path in a grid
-
B.
When the heuristic is not available
-
C.
When the graph has negative weights
-
D.
When you need to find all paths
Solution
Dijkstra's algorithm is preferred when there is no heuristic available, as A* relies on heuristics to guide its search.
Correct Answer:
B
— When the heuristic is not available
Learn More →
Q. Which of the following applications can Dijkstra's algorithm be used for?
-
A.
Finding the minimum spanning tree
-
B.
Routing in computer networks
-
C.
Sorting a list of numbers
-
D.
Searching for an element in a database
Solution
Dijkstra's algorithm is commonly used in routing algorithms for computer networks to find the shortest path for data packets.
Correct Answer:
B
— Routing in computer networks
Learn More →
Showing 1 to 2 of 2 (1 Pages)