1.

In the given graph, identify the path that has minimum cost to travel from node a to node f.(a) a-b-c-f(b) a-d-e-f(c) a-d-b-c-f(d) a-d-b-c-e-fThe question was posed to me in exam.This intriguing question comes from Shortest Path in portion Shortest Path of Data Structures & Algorithms II

Answer»

The CORRECT choice is (d) a-d-b-c-e-f

Easy explanation - The minimum COST taken by the path a-d-b-c-e-f is 4.

a-d, cost=2

d-b, cost=-2

b-c, cost=1

c-e, cost= 2

e-f, cost=1

Hence the TOTAL cost is 4.



Discussion

No Comment Found

Related InterviewSolutions