In a social networking service, a user has friends, the friends have other friends, and so on.

Question:

In a social networking service, a user has friends, the friends have other friends, and so on. We are interested in knowing how many people can be reached from a person by following a given number of friendship relations. This number is called the “degree of separation”: one for friends, two for friends of friends, and so on. Because we do not have the data from an actual social network, we will simply use an average of the number of friends per user. Write a recursive method public static double reachablePeople(int degree, double averageFriendsPerUser) Use that method in a program that prompts the user for the desired degree and average, and then prints the number of reachable people. This number should include the original user.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: