Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Insert into a Binary Search Tree
Bookmark
Input
Insert 5 (Right subtree)
Insert 25 (Balanced tree)
Custom
treeNodes
=
[4, 2, 7, 1, 3]
,
value
=
5
4
2
7
1
3
4
2
7
1
3
4
2
7
1
3
curr
4
2
7
1
3
curr
4
2
7
1
3
curr
4
2
7
1
3
curr
4
2
7
1
3
5
curr
4
2
7
1
3
5
algo
master
.
io
Step:
Start: Insert 5 into BST
0 / 6
Input
Insert 5 (Right subtree)
Insert 25 (Balanced tree)
Custom
treeNodes
=
[4, 2, 7, 1, 3]
,
value
=
5
0 / 6
algo
master
.
io
Step:
Start: Insert 5 into BST