Question: 1. Computational Problem Solving: Problem specification & Strategy design: Circle of Friends (8 points) Spacebook (an intergalactic social network company) has hired you as a

1. Computational Problem Solving: Problem specification & Strategy design: Circle of Friends (8 points)

Spacebook (an intergalactic social network company) has hired you as a highly paid software engineer. Its CEO, Lieutenant Worf, wants to implement a privacy policy he calls Friend Circles. All your immediate Spacebook friends are in your circle of friends of radius 1. Their friends are in your friend circle of radius 2. Their friends are in your friend circle of radius 3. And so on. Any member of Spacebook, if he/she/it can only be on at most one friend circle i.e., if someone can be a member of multiple friend circles by the above logic, then that being can only be assigned to that friend circle which has the smallest radius. E.g., if Kirk is friends with you and he is also friends with Uhura and Sulu, and if Uhura is friends with Sulu then Sulu will be in your friend circle of radius 2 (not radius 3). Worfs privacy policy is that he would allow each Spacebook member to specify which friend circle(s) can view an item he/she/it posts. To implement such a policy, Spacebooks computers need to be able to compute all members of a particular members friend circle of radius m, m > 0. Lt. Worf asks you (assume you speak Klingon fluently) to come up with a way to solve this problem.

So of course, you start by developing a well-defined problem specification! Some parts of such a specification is below. Complete the missing part Correctness criteria.

Input(s):

1. For each Spacebook member, an alphabetically ordered linked list of his/her/its immediate Spacebook friends.

2. A member x.

3. A radius value m, m>0.

Output(s): An alphabetically ordered linked list of all members in xs friend circle of radius m.

Correctness Criteria:

Given the problem specification above, come up with a computational strategy to solve it. Explain it below. Your explanation should be such that we can understand your strategy well enough to turn it into an algorithm, but not so detailed that what you provide becomes an algorithm and not a strategy.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!