Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Minimum Height Trees
Bookmark
Input
Example 1
Star Graph
Linear
Custom
n
=
6
,
edges
=
[[3,0],[3,1],[3,2],[3,4],[5,4]]
0
1
2
3
4
5
Leaves:
Degree:
1
0
1
1
1
2
4
3
2
4
1
5
MHT Roots:
Legend:
Default
Leaf
Processing
MHT Root
Removed
algo
master
.
io
Step:
Initialize degree array: [1, 1, 1, 4, 2, 1]
0 / 14
Input
Example 1
Star Graph
Linear
Custom
n
=
6
,
edges
=
[[3,0],[3,1],[3,2],[3,4],[5,4]]
0 / 14
0
1
2
3
4
5
Leaves:
Degree:
1
0
1
1
1
2
4
3
2
4
1
5
MHT Roots:
Legend:
Default
Leaf
Processing
MHT Root
Removed
algo
master
.
io
Step:
Initialize degree array: [1, 1, 1, 4, 2, 1]