Question: Code in Java Please. Given the first line which has integers x,k,z the number of vertices, graphs, and edges. The next lines will contain three
Code in Java Please.
Given the first line which has integers x,k,z the number of vertices, graphs, and edges.
The next lines will contain three integers; a,b,c.
c is the distance between nodes a and b.
Create k minimum spanning trees, and return the highest edge weight. For example, example 0 would return 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 Example 1 input: 5 4 10 1 21 1 3 2 144 1 5 5 2 3 4 2 4 3 2 5 6 34 1 3 5 7 4 58 output: 1 Example 2 input: 6 4 10 1 26 1 4 5 1 54 24.1 2 5 2 2 3 5 2 63 3 64 4 52 5 64 output: 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
