Learn
Practice
Newsletter
Resources
Resume
New
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Delete Nodes And Return Forest
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, 5, 6, 7]
,
toDelete
=
[3, 5]
1
2
3
4
5
6
7
Forest: []
current
forest root
deleting
kept
Step:
Start: Delete nodes [3,5] and return forest
Variable
Value
root
"Node(1)"
to_delete
"[3, 5]"
forest
[]
Depth
Function Call
1
delNodes(Node(1), [3, 5])
0 / 38
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, 5, 6, 7]
,
toDelete
=
[3, 5]
0 / 38
1
2
3
4
5
6
7
Forest: []
current
forest root
deleting
kept
Step:
Start: Delete nodes [3,5] and return forest
Visualization
Variables