Given the root of a binary search tree and an integer k, return the k-th smallest value (1-indexed) of all the values of the nodes in the tree.
Note: The tree is given as a level-order array where the node at index i has its left child at index 2*i + 1 and its right child at index 2*i + 2, with null for missing nodes (trailing positions may be omitted).
For example, [3, 1, 4, null, 2] represents:
3
/ \
1 4
\
2