Last updated 4 years ago
Given the root of a BST, find the kth smallest element.
I: tree = [3,1,4,null,2], k = 1 3 / \ 1 4 \ 2 O: 1 I: tree = [5,3,6,2,4,null,null,1], k = 3 5 / \ 3 6 / \ 2 4 / 1 O: 3