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:

\f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
