Back to DSA sheet

Kth Smallest Element in BST

MediumBST
Open on LeetCodeAmazonGoogle

Return the k-th smallest value in a binary search tree (1-indexed).

Constraints
  • 1 <= k <= nodes <= 10^4
  • 0 <= Node.val <= 10^4
Sheets
Blind 75Grind 75NeetCode 150
kth-smallest-element-in-bst.cpp
Loading editor
Custom input (stdin)
Output

Run your code to see its output.