get A's friends into array a[]
get B's friend into array b[]

use algo to find if they have at least one common element.
Assume A is in the friends list of A(in array a[])  and B is in the friends
list of B(in array b[]).

If they have common element(friend) show else don't show.




On Thu, Mar 24, 2011 at 6:39 PM, ligerdave <[email protected]> wrote:

> Instead of looking for a common friend of A and B, look for someone
> who has friends A and B.
>
> if you are using relational DB, use count()
>
>
> didn't quite understand your first part that "only if A is friend of
> B". i assume when A is a friend of B, B is a friend of A as well
>
> On Mar 24, 6:43 am, snehal jain <[email protected]> wrote:
> > Suppose there are 2 persons A and B on FB . A should be able to view
> > the pictures of B only if either A is friend of B or A and B have at
> > least one common friend .
>
> --
> 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.
>
>


-- 
Thank You
Rajeev Kumar

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