Kth Smallest Element in a BST

Medium · Binary Search Trees · about 15 minutes

Asked at Amazon, Google, Uber, Meta.

Return the k-th smallest value stored in a binary search tree, counting from k = 1 for the minimum.

Related guides