Question

Write pseudo-code to solve the problem using MapReduce and explain how it works. Each line in...

Write pseudo-code to solve the problem using MapReduce and explain how it works.

Each line in the file lists a person’s ID, name, age, and the number of friends he or she has. For example line 1 indicates that the person has ID of 0, his name is Will, his age is 33, and he has 385 friends. Given the file, find out the average number of friends by age.

0,Will,33,385

1,Jean-Luc,26,2

2,Hugh,55,221

3,Deanna,40,465

4,Quark,68,21

5,Weyoun,59,318

Homework Answers

Answer #1

Pseudo code:

step1: read the file with read mode

step2: read each line in the file and split with comma(,)

step3: then take 2 and 3 index data make sum and increment cnt

step4: finally age/cnt and number/cnt

step5:finally print the average age and average friends

step6:colse the file

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT...
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT EACH IS CODE IS DOING THANKS. PLEASE COPY PASTE AFTER YOURE DONE NOT SCREENSHOT BECAUSE I NEED TO BE ABLE TO EDIT IT THANKS. // MODULE B: Method 2: Embedding an in-line asssembly language module in a C progrmming #include "stdafx.h" #include "stdio.h" #include<iostream> int main () { printf(" Lab_No_01_Getting_Stated_into_x86_Assembly_from_a_C++_program\n"); // Lab number and title here printf(" Module B: Embedding an in-line asssembly language...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input operator>> a bigint in the following manner: Read in any number of digits [0-9] until a semi colon ";" is encountered. The number may span over multiple lines. You can assume the input is valid. Overload the operator+ so that it adds two bigint together. Overload the subscript operator[]. It should return the i-th digit, where i is the 10^i position. So the first...
Tax Return Project James A. Varney and Denise M. Varney James and Denise Varney are married...
Tax Return Project James A. Varney and Denise M. Varney James and Denise Varney are married and file a joint return. James is 48 years of age and Denise is 49. James is employed full-time as an electrical engineer for Livingston Unitech Corporation, Ltd. Denise is a self-employed design consultant. They have two children, Pamela and Vernon, who live at home and receive all of their support from their parents. Pamela is 20 years old and attended college on a...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT