Question: Your task is to implement the Diameter class in Diameter.java file to return the graph diameter in the facebook data set by writing the following

Your task is to implement the Diameter class in Diameter.java file to return the graph diameter in the facebook data set by writing the following APIs.

? public Diameter(Graph g): this is the constructor to compute the graph diameter. Here, we assume the graph g is connected. To assure that, we load facebook_1000.txt to construct the graph g for testing.

? public int getDiameter(): this is the method to return the graph diameter.

import java.util.*;

public class Diameter {

// place your code here

public Diameter(Graph g) {

// place your code here

}

public int getDiameter() {

// place your code here

return 0;

}

}

facebook_1000.txt:

Your task is to implement the Diameter class in Diameter.java file to

\f

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!