logo CodeStepByStep logo


Language/Type: C++ graphs collections
Related Links:
Author: Marty Stepp (on 11/14)

Write a function coolest that accepts a string representing a file name as a parameter and reads this file of Twitter followers, with each line representing "name1 follows name2":

name1 name2
name1 name2

And returns a string representing the name of the person with the most followers-of-followers. Use a BasicGraph to help you compute the answer.

You may assume that the input file exists, follows the format above, contains valid data, and contains at least one person who has at least one follower-of-followers.

Type your C++ solution code here:

This is a function problem. Write a C++ function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.

Log In

Need help?

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.

© Marty Stepp, all rights reserved.