Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Convert Sorted List to Binary Search Tree
Bookmark
Array + D&C
Slow / Fast
In-Order
Input
Standard
Longer
Custom
nums
=
[-10, -3, 0, 5, 9]
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
build(0,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
build(0,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
build(0,4)
▸
build(0,1)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
-10
build(0,4)
▸
build(0,1)
▸
build(1,1)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
-10
build(0,4)
▸
build(0,1)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
-10
-3
build(0,4)
▸
build(3,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
-10
-3
build(0,4)
▸
build(3,4)
▸
build(4,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
HEIGHT-BALANCED BST
0
-10
5
-3
build(0,4)
▸
build(3,4)
▸
build(4,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
mid
HEIGHT-BALANCED BST
0
-10
5
-3
9
build(0,4)
SORTED LIST
-10
0
-3
1
0
2
5
3
9
4
HEIGHT-BALANCED BST
0
-10
5
-3
9
algo
master
.
io
Step:
Start: convert a sorted linked list into a height-balanced BST
0 / 27
Input
Standard
Longer
Custom
nums
=
[-10, -3, 0, 5, 9]
0 / 27
algo
master
.
io
Step:
Start: convert a sorted linked list into a height-balanced BST