
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Problem Description
Learn Clojure
In this problem, each person in the social network takes a specific
time to send the message(time is an integer). A specific newbie in
react(let's call him NB) wants to post a question to a ninja(let's
call him NJ) on the network. Find out how long a specific
message takes to reach NJ from NB. The social network is given
as the input as follows. The first line is a number which is the
number of people in the social network. The next following lines
are the actual members of the social network whose names are
written in separate lines. Following that is the number of
connections, followed by a new line separated list of connections
given as <follower> <following> <time it takes to send the
message>. Then on the next line is the person who wants to send
the message(NB's id in our case) and on the next line is the
person who is the intended recipient(NJ's id).
The output should be a single line consisting of the time it takes
to send the message through or -1 if the message can't be sent.
INPUT FORMAT
total members in ReactCommunity Network
memberId1
MemberId2
MemberIdN
L
Total possible edges
<follower1> <following 1> <time taken to send the message

Transcribed Image Text:Problem Description
Learn Clojure
In this problem, each person in the social network takes a specific
time to send the message(time is an integer). A specific newbie in
react(let's call him NB) wants to post a question to a ninja(let's
call him NJ) on the network. Find out how long a specific
message takes to reach NJ from NB. The social network is given
as the input as follows. The first line is a number which is the
number of people in the social network. The next following lines
are the actual members of the social network whose names are
written in separate lines. Following that is the number of
connections, followed by a new line separated list of connections
given as <follower> <following> <time it takes to send the
message>. Then on the next line is the person who wants to send
the message(NB's id in our case) and on the next line is the
person who is the intended recipient(NJ's id).
The output should be a single line consisting of the time it takes
to send the message through or -1 if the message can't be sent.
INPUT FORMAT
total members in ReactCommunity Network
memberId1
MemberId2
MemberIdN
L
Total possible edges
<follower1> <following 1> <time taken to send the message
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images

Knowledge Booster
Similar questions
- Q8 Hive Minds: Migrating Birds You again control a single insect, but there are B birds flying along known paths. Specifically, at time t each bird b will be at position (x¿(t), Yb(t)). The tuple of bird positions repeats with period T. Birds might move up to 3 squares per time step. An example is shown below, but keep in mind that you should answer for a general instance of the problem, not simply the map and path shown below. Your insect can share squares with birds and it can even hitch a ride on them! On any time step that your insect shares a square with a bird, the insect may either move as normal or move directly to the bird's next location (either action has cost 1, even if the bird travels farther than one square).arrow_forwardQ2: Secret Courses Dan's recently announced that he's teaching n top-secret courses next semester. Instead of enrolling in them through ACORN, students need to email Dan to express their interests. These courses are numbered from 1 to n in some arbitrary order. In particular, if a student named s is interested in taking a course c, they need to send an email to Dan containing the message c s. Note that if a student is interested in taking multiple courses, they need to send multiple emails, one per course. Upon receiving a message c s, Dan looks at the list of students already enrolled in course c. If there's already a student on the list whose name is too similar to s, Dan assumes s is the same student and ignores the message. Otherwise, he enrolls s in the course. Dan considers two names too similar if and only if they have the same length and differ in at most one letter (note that "a" and "A" are considered the same letter). For example, "Josh" and "Josh" are too similar. "Sam" and…arrow_forward
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY