Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

shortest path in unweighted graph bfs

Input: source vertex = 0 and destination vertex is = 7.
Output: Shortest path length is:2
        Path is::
        0 3 7

Input: source vertex is = 2 and destination vertex is = 6.
Output: Shortest path length is:5
        Path is::
        2 1 0 3 4 6
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #shortest #path #unweighted #graph #bfs
ADD COMMENT
Topic
Name
4+1 =