Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how can i find implement the int FbFriendRecs 1 ( Fb fb , char * name , struct recommendation recs [ ] ) function such
how can i find implement the int FbFriendRecsFb fb char name struct recommendation recs function such that it takes the name of a person and finds friend recommendations for them. The function should store the recommendations for them in the given recs array and return the number of recommendations stored in the array.
The function should only recommend people who are friends of friends of the person. In other words, it should only recommend people who share at least one mutual friend with the person. Obviously, it should not recommend someone who is already the person's friend.
Each recommendation consists of the name of the person being recommended and the number of mutual friends they share with the given person.
The recommendations should be sorted in descending order on the number of mutual friends shared, since someone with more mutual friends is more likely to be known by the person, and is therefore more likely to be added as a friend. If two people share the same number of mutual friends, they may be sorted in any order. please do not use functions like qsort. note: I already have a mutual friends function that returning the list of mutual friends.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started