CS FundamentalsVery hardProduct company interview · GATE level
Dijkstra's algorithm is run from S on an undirected network with link costs S-A 7, S-B 2, S-C 6, A-B 3, B-D 8, A-D 4, B-C 5, C-E 5, D-E 1, D-F 6 and E-F 9. In what order are the nodes finalised, and what successive tentative labels does node E receive?
- A. S, B, A, C, D, E, F; E is labelled 10 only
- B. S, B, A, C, D, E, F; E is labelled 11, then 10
- C. S, B, C, A, D, E, F; E is labelled 11, then 10
- D. S, B, A, D, C, E, F; E is labelled 10 only
Correct answer: B. S, B, A, C, D, E, F; E is labelled 11, then 10
From S: A = 7, B = 2, C = 6. Finalise B (2): A improves to 5, D = 10, C stays 6 (2 + 5 = 7 is worse). Finalise A (5): D improves to 9. Finalise C (6): E = 11. Finalise D (9): E improves to 10, F = 15. Finalise E (10): F stays 15 (10 + 9 = 19). Finalise F (15). C (6) is finalised before D (9), so E is first labelled 11 through C and only later lowered to 10 through D. A (5) leaves the queue before C (6) because of the relaxation through B.
More Computer Networks questions
- The block 10.20.64.0/20 is allocated with VLSM, always taking the lowest free addresses and handling requests in this order: LANs needing…
- A router uses longest-prefix matching with these entries: 10.4.0.0/14 -> interface A, 10.6.0.0/15 -> interface B, 10.6.128.0/17 ->…
- A site owns 172.18.72.0/22, 172.18.76.0/23 and 172.18.80.0/22 and wants to advertise them with one prefix. What is the smallest single…
- From the block 192.168.0.0/22, three subnets have already been assigned: 192.168.1.64/26, 192.168.2.0/25 and 192.168.3.240/28. How many…
- Host X sends 10 packets of 1000 bytes each to host Y through two store-and-forward routers. The three links on the path have rates 2 Mbps…
- A 4800-byte message is sent over a path of 4 store-and-forward links of equal rate (3 routers), with negligible propagation delay. The…