Which of the following is a characteristic of Dijkstra's algorithm?
Practice Questions
Q1
Which of the following is a characteristic of Dijkstra's algorithm?
It uses depth-first search.
It guarantees the shortest path in all cases.
It can be used for both directed and undirected graphs.
It requires all edge weights to be the same.
Questions & Step-by-Step Solutions
Which of the following is a characteristic of Dijkstra's algorithm?
Step 1: Understand that Dijkstra's algorithm is a method used to find the shortest path in a graph.
Step 2: Know that a graph can be directed (where edges have a direction) or undirected (where edges do not have a direction).
Step 3: Remember that Dijkstra's algorithm works only if all the weights (or costs) of the edges in the graph are non-negative (meaning they cannot be negative).
Step 4: Conclude that Dijkstra's algorithm can be applied to both types of graphs (directed and undirected) as long as the edge weights are non-negative.