@atul .. yeah bfs may not work or less efficient . ..assume graph of m*n nodes , m,n are very large .. one simple thing we can do find the path between any given two nodes i,j , if path exist list out all the nodes we encounter , one imprtant thinsg to be noticed is that , path can be of 1 degree , 2 degree , or any k degree , where k <=m-1 & k<=n-1 e.g. ....there many issue need to take careoff such as there may more then one path from source to dest. as each path has different length so we have to check if we have already visited the same node or not . if not then add this node to final list which shows the all mutual friends between given nodes .
@all Whats Say ? Thanks Shashank Mani Narayan Computer Science BIrla Institute of Technology Mesra -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/QJ7ku0ueeBwJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
