CS FundamentalsVery hardHCL · Tech Mahindra pattern

Run Dijkstra's algorithm on this undirected weighted graph (edges given as node-node:weight): S-A:2, S-B:6, A-B:2, A-C:7, B-C:3, C-T:2, B-T:8. Starting from S, what is the shortest-path distance to T?

  1. A. 9
  2. B. 10
  3. C. 8
  4. D. 11

Correct answer: A. 9

Dijkstra from S settles nodes in increasing distance order; the shortest-path distance it finds to T is 9.

More Computer Networks questions

Exams that ask this topic