Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Find Duplicate Subtrees
Bookmark
Input
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, null, 2, 4, null, null, 4]
1
2
3
4
2
4
4
ids
result
identical subtrees share one serialization id
algo
master
.
io
Step:
Start: identical subtrees produce identical serializations
0 / 54
Input
Example 1
Example 2
Example 3
Custom
tree
=
[1, 2, 3, 4, null, 2, 4, null, null, 4]
0 / 54
1
2
3
4
2
4
4
ids
result
identical subtrees share one serialization id
algo
master
.
io
Step:
Start: identical subtrees produce identical serializations