Given the root of a binary search tree, and an integer k, return the kth smallest value in the BST.
null for empty)kInput:
[3,1,4,null,2]
1
Output: 1
Input:
[5,3,6,2,4,null,null,1]
3
Output: 3
Your program must print only the integer result.
No submissions yet.
Discuss inorder traversal, recursion vs iteration, and BST properties.