CS FundamentalsVery hardHCL · Tech Mahindra pattern

Run Dijkstra's algorithm on this undirected weighted graph (node-node:weight): P-Q:6, P-R:3, Q-R:2, Q-S:5, R-S:4, S-T:2, R-T:9. Starting from P, what is the shortest-path distance to T?

  1. A. 7
  2. B. 12
  3. C. 9
  4. D. 10

Correct answer: C. 9

Dijkstra from P settles nodes in increasing order of distance; the shortest distance found to T is 9.

More Computer Networks questions

Exams that ask this topic