CS FundamentalsVery hardAccenture · Tech Mahindra pattern

Run Dijkstra's algorithm on this undirected weighted graph (edges given as node-node:weight): A-B:7, A-C:9, A-F:14, B-C:10, B-D:15, C-D:11, C-F:2, D-E:6, E-F:9. Starting from A, what is the shortest-path distance to E?

  1. A. 22
  2. B. 20
  3. C. 21
  4. D. 19

Correct answer: B. 20

Dijkstra from A settles nodes in increasing distance order; the shortest-path distance it finds to E is 20.

More Computer Networks questions

Exams that ask this topic