Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Kth Smallest Element in a BST
Bookmark
Input
Example 1
Example 2
Example 3
Custom
tree
=
[3, 1, 4, null, 2]
,
k
=
1
3
1
4
2
k = 1
stack
sorted
inorder visits BST values in ascending order
algo
master
.
io
Step:
Start: the 1st node visited in inorder is the 1st smallest
0 / 9
Input
Example 1
Example 2
Example 3
Custom
tree
=
[3, 1, 4, null, 2]
,
k
=
1
0 / 9
3
1
4
2
k = 1
stack
sorted
inorder visits BST values in ascending order
algo
master
.
io
Step:
Start: the 1st node visited in inorder is the 1st smallest