Desktop OnlyOur product is currently optimized for best experience on desktop device only
Problem
Submissions

Problem: Kth Smallest Element in a BST

Statement

Given the root node of a binary search tree and an integer value k, return the kthk^{th} smallest value in the tree.

Constraints:

  • The number of nodes in the tree is nn.
  • 1≤k≤n≤5001 \leq k \leq n \leq 500
  • 0≤0 \leq Node.data ≤104\leq 10^4