Description:
Solution:
First, we keep going left in tree.
We put the values in stack.
Pop the value from the stack. => From most smallest value.
Everytime we pop, increase n to check if there is kth smallest value.
If it doensn't exist, now we can go right at current node to see the next.
'LeetCode ๐๏ธ > Tree' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
211. Design Add and Search Words Data Structure (0) | 2023.06.11 |
---|---|
235. Lowest Common Ancestor of a Binary Search Tree (0) | 2023.06.09 |
297. Serialize and Deserialize Binary Tree (0) | 2023.06.04 |
98. Validate Binary Search Tree (0) | 2023.06.03 |
105. Construct Binary Tree from Preorder and Inorder Traversal (0) | 2023.06.02 |