Given a BST, find the kth smallest element (1-indexed).
Since inorder traversal of BST = sorted order, the kth smallest is just the kth element in inorder traversal!
The iterative approach with early stopping is more efficient when k is small.
kth_smallest(root, 1)
1
kth_smallest(root, 3)
3