Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. (20 points) This question involves programming. You are free to use any language Java, C++, Python, etc of your choice, as long as you

4. (20 points) This question involves programming. You are free to use any language Java, C++, Python, etc of your choice, as long as you include your code, along with comments explaining what the code does, and a screenshot of the output of your program.

Suppose you are the inventor of a social network (call it Fussbook). You maintain a file, fussbook_network.txt, which describe the friendships between of individuals on Fussbook. Assume that all relationships are symmetric, i.e., the graph is undirected.

a. Write a small program that takes a filename as input, opens and parses the file, and outputs the number of nodes and edges in the network.

b. Write another small program that automatically determines the most well-connected person in Fussbook.

fussbook_network.txt is below

1. is friends with 11

11 is friends with 9

4 is friends with 11

6 is friends with 11

6 is friends with 7

2. is friends with 7

5 is friends with 2

5 is friends with 2

3. is friends with 8

8 is friends with 3

10 is friends with 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions