[Tree] Kth Smallest Element in a BST
2021. 3. 27. 15:09ㆍ프로그래밍-코딩테스트/LeetCode

Tree와 index k 가 주어졌을때 k번째로 작은 node는 무엇인지 구하라는 문제

간단한 DFS문제이다
DFS순서에 따라 이진트리의 value를 정렬하면 내림차순으로 정렬된다
'프로그래밍-코딩테스트 > LeetCode' 카테고리의 다른 글
| [DP] Palindromic Substrings (0) | 2021.03.27 |
|---|---|
| [Hash] Top K Frequent Elements (0) | 2021.03.27 |
| [Stack] Daily Temperatures (0) | 2021.03.27 |
| [Array] Subsets (0) | 2021.03.27 |
| [backtracking] Generate Parentheses (0) | 2021.03.26 |