@WgpShashank : Suppose 'A' is friends both with 'B' nd 'C' .. Also 'D' has
friends 'B' and "C" .
also "B" and "C" are connected
Note A is not friends with "D" . Now if "A" wants to view the profile of
"D" then it shows that B and C are its mutual friends..  (aayush this is
the problem statement)
Now i want to ask is their are 3 paths from "A" to "D" i.e. A->B->C->D and
A->B->D and A->C->D .... so how these dealt that which one to choose !!

On Wed, Jan 18, 2012 at 4:39 PM, WgpShashank <[email protected]>wrote:

> @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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
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.

Reply via email to