Question: Create this program in JAVA Must be in JAVA Given input 9 3 13 // vertices, graphs to make, and edges. 8 1 8 //

Create this program in JAVA

Must be in JAVA

Given input

9 3 13 // vertices, graphs to make, and edges.

8 1 8 // 8 is the distance between node 8 and node 1

8 2 11 // 11 is the distance between node 8 and node 2

8 9 7 //7 is the distance between node 8 and node 9

8 7 1

7 9 6

7 6 2

1 2 4

2 3 8

9 3 2

6 3 4

6 5 10

5 4 9

3 4 7

Return 7 // the highest edge weight in the graph

if k is the input, first create a minimum spanning tree.

Then divide the tree into k trees.

Return the highest edge weight in the trees

The graph below would return 7.

Create this program in JAVA Must be in JAVA Given input 9

4 2 8 Examples Example 0 9 3 13 For the following graph: 8 18 8 2 11 8 97 8 7 1 8 7 96 7 6 2 1 2 4 8 2 38 7 9 3 2 6 3 4 1 6 5 10 5 49 3 4 7 7 3 11 9 2 7 6 4 4 2 6 5 9 10 When k=3, we get: 4 1 2 3 8 8 9 2 7 1 4 7 4 2 6 5 Maximum spacing=7 4 2 8 Examples Example 0 9 3 13 For the following graph: 8 18 8 2 11 8 97 8 7 1 8 7 96 7 6 2 1 2 4 8 2 38 7 9 3 2 6 3 4 1 6 5 10 5 49 3 4 7 7 3 11 9 2 7 6 4 4 2 6 5 9 10 When k=3, we get: 4 1 2 3 8 8 9 2 7 1 4 7 4 2 6 5 Maximum spacing=7

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 Databases Questions!