Answer to Question #289231 in C for Rupa

Question #289231

*in the given problem i need mainly Implement forward star graph representation*



Write a C program to compute shortest path between two given nodes for an unweighted undirected connected graph.



You should implement the following:



1. Implement forward star graph representation



2. Use bfs to compute the shortest path (you should use the forward star representation that you have implemented in the BFS)



3. Write a test function which reads number of vertices, number of edges, the sequence of edges followed by source and destination vertices from stdin.



Sample Input/Output: (for K4 - complete graph on 4 vertices, vertex index starts from 0)



Input: 4 6 0 1 0 2 0 3 1 0 1 2 1 3 2 0 2 1 2 3 3 0 3 1 3 2 0 3



Output: 1



You should print "INVALID INPUT" for all invalid input cases.

1
Expert's answer
2022-01-22T11:20:38-0500
Dear Rupa, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS