Start learning →

Order the steps of Dijkstra's algorithm

Exercise and reference answers

Steps
  1. Initialise distances: source = 0, all others = ∞
  2. Mark all nodes as unvisited
  3. Pick the unvisited node with smallest tentative distance
  4. Update distances of its neighbours through that node
  5. Mark current node as visited
  6. Repeat until all reachable nodes are visited
Continue learning with Quill →

Browse more GATE CSE questions and exercises →