Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Unique Binary Search Trees II
Bookmark
Input
Standard
Small
Larger
Custom
n
=
3
unique BSTs for 1..3
1
2
3
0 / 5
root 1
root 2
root 3
pick each value as the root, combine all
left
×
right
subtrees
algo
master
.
io
Step:
Generate every unique BST holding the values 1..3
0 / 9
Input
Standard
Small
Larger
Custom
n
=
3
0 / 9
unique BSTs for 1..3
1
2
3
0 / 5
root 1
root 2
root 3
pick each value as the root, combine all
left
×
right
subtrees
algo
master
.
io
Step:
Generate every unique BST holding the values 1..3