Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Convert Sorted Array to Binary Search Tree
Bookmark
Input
Example 1
Complete BST
Nine Elements
Custom
nums
=
[-10, -3, 0, 5, 9]
nums
-10
0
-3
1
0
2
5
3
9
4
mid becomes the root, halves become
subtrees
algo
master
.
io
Step:
Start: build a height-balanced BST from the sorted array
0 / 33
Input
Example 1
Complete BST
Nine Elements
Custom
nums
=
[-10, -3, 0, 5, 9]
0 / 33
nums
-10
0
-3
1
0
2
5
3
9
4
mid becomes the root, halves become
subtrees
algo
master
.
io
Step:
Start: build a height-balanced BST from the sorted array