Leetcode 230. Kth Smallest Element in a BST
Return the k-th smallest value (1-indexed) in a BST — exploit that an in-order traversal yields values in sorted order and pick the k-th visited node. For frequent updates/queries, augment the BST with subtree sizes (an order-statistic tree) to support O(log n) queries and updates.
Asked at:
Google
Amazon
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early March, 2025
Meta
Senior
Early February, 2025
Junior
Mid January, 2025
Senior
Find the kth smallest element in a BST
Hello Interview Premium
Your account is free and you can post anonymously if you choose.