Question: 3 Given that somebody has already defined the required structs represent a road map as a graph, like this: to struct town string name; int
3 Given that somebody has already defined the required structs represent a road map as a graph, like this: to struct town string name; int distance; roadlink roads; ) struct roadlink int length; town whereto; roadlink next; ) s you can see, the programmer chose not to give each town a vector for the roads that le ad from it, but a linked list instead. Each roadlink at it leads to. The programmer has even written the code that correctly constructs the graph. records the length of a road leading from the current town, and the town th What you have to do is write the code that will find the length of the shortest path between two towns. Write a function int shortest (town A, town B) that performs this task. Of course you may define any other functions or data structures that will make the job easier
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
