k-th smallest in a search tree
Write kth_smallest(root, k) that returns the k-th smallest value in a binary search
tree, with k = 1 the smallest. k is at most the number of nodes.
kth_smallest([3, 1, 4, None, 2], 1) -> 1
kth_smallest([5, 3, 6, 2, 4, None, None, 1], 3) -> 3
The point is to practise stopping an in-order traversal early.
def kth_smallest(root, k):
...