-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path06outputMST.txt
More file actions
21 lines (19 loc) · 754 Bytes
/
Copy path06outputMST.txt
File metadata and controls
21 lines (19 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
find(3) returns 3, find(5) returns 5, Union(3, 5) done
find(6) returns 6, find(7) returns 7, Union(6, 7) done
find(3) returns 3, find(4) returns 4, Union(3, 4) done
find(4) returns 3, find(8) returns 8, Union(3, 8) done
find(1) returns 1, find(2) returns 2, Union(1, 2) done
find(4) returns 3, find(5) returns 3, No union performed
find(1) returns 1, find(6) returns 6, Union(1, 6) done
find(1) returns 1, find(7) returns 1, No union performed
find(5) returns 3, find(8) returns 3, No union performed
find(3) returns 3, find(6) returns 1, Union(3, 1) done
Final Minimum Spanning Tree (7 edges)
(3, 5) weight: 2
(6, 7) weight: 5
(3, 4) weight: 6
(4, 8) weight: 7
(1, 2) weight: 9
(1, 6) weight: 14
(3, 6) weight: 18
Total weight of all edges in MST: 61