Problem
Given the root of a BST and an integer k, return the kth smallest value among all node values.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Inorder traversal visits nodes in ascending order. Stop at the kth node. Iterative inorder with a stack avoids full traversal.
Problem
Given the root of a BST and an integer k, return the kth smallest value among all node values.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Inorder traversal visits nodes in ascending order. Stop at the kth node. Iterative inorder with a stack avoids full traversal.