In the function bfs( ),
One why we made the map< T , T > parent.
Is it necessary ??
Bfs : shoretest path
hey @AnonymousReta
storing parents is necessary when you have to print the shortest path ,
if you do not have to print the path, just wanted to print the distance then you can ignore it.
Got it!!
Thanku so much:blush:
1 Like