Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is Dijkstra's algorithm used for?
Think about shortest path problems.
What is the initial distance of all vertices at the start of Dijkstra's algorithm?
Consider what we do before starting the pathfinding.
What is the time complexity of Dijkstra's algorithm when using an adjacency matrix?
Consider how many vertices you need to scan.
Dijkstra's algorithm can handle negative edge weights appropriately.
Think about the implications of negative weights on distance calculations.
Given a graph with vertices labeled A to E, and weights as follows: A-B: 1, A-C: 5, B-C: 2, B-D: 4, C-D: 1, C-E: 3, D-E: 2. Determine the shortest path from A to E using Dijkstra's algorithm.
Draw the graph and systematically calculate distances while burning vertices.
Create a graph with at least one negative edge but without a negative cycle. Apply Dijkstra's algorithm and explain the outcome.
Define distances carefully to see where the pitfalls are.
4 more questions in this section. Enroll free to practise them all.
Enroll free