[Note: You should submit pseudocode rather than actual java or c or python code. Please write your own solution in your own words.]
Write Map and Reduce functions in pseudocode for the following problem:
Assume that you have the Twitter follower list for a large number of users. The follower list is provided in the following format:
first users twitter handle, second users twitter handle
to indicate that the second user is a follower of the first user.
For example,
alice01, bob02
would indicate that bob02 follows alice01.
(a) [15 points] Given input data containing many such user, follower pairs, write map and reduce functions to calculate the total number of followers for each user. The output file should contain the user names followed by a comma followed by a number indicating the number of followers of the user.
For example, if alice01 has 7 followers, then the output should contain the line alice01, 7
[Hint: You can adapt the word count example to solve the above problem]
(b) [5 bonus points] Giveninput data containing many such user, follower pairs, write map and reduce functions to calculate the number of common followers for all pairs of users.
For example, if alice01 and bob02 has 3 common followers, then the output should contain the line alice01, bob02, 3
Reviews
There are no reviews yet.