Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Delete Nodes And Return Forest
1
delNodes(Node(1), [3, 5])
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, 5, 6, 7]
,
toDelete
=
[3, 5]
delete
3
5
1
2
3
4
5
6
7
forest
delete the marked values, survivors form a forest
Step:
Start: delete [3,5], the survivors split into a forest
0 / 38
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, 5, 6, 7]
,
toDelete
=
[3, 5]
0 / 38
delete
3
5
1
2
3
4
5
6
7
forest
delete the marked values, survivors form a forest
Step:
Start: delete [3,5], the survivors split into a forest
1
delNodes(Node(1), [3, 5])