
Question Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. 이진 탐색 트리와 정수 k가 주어졌을 때, 모든 노드 중 k번째로 작은 값을 리턴하는 함수를 작성하라. 제약사항 The number of nodes in the tree is n. 1 right); } int kthSmallest(TreeNode* root, int k) { vector node_val_vec; AddAllElement(node_val_vec, root); return node_val_vec[k-1]; } }; Time..
IT/Problem Solving
2022. 8. 20. 23:44
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 자료구조
- interview question
- PS
- 코딩인터뷰
- Tree
- 속초
- 속초 맛집
- 리트코드
- coding interview
- algorithm
- 기술면접
- LeetCode
- DP
- 러스트 배우기
- 맛집
- Interview
- 솔직후기
- 러스트 기초
- 트리
- Medium
- 러스트 입문
- 내돈내산
- 알고리즘
- C++
- 인터뷰
- 반드시 알아야 할 자료구조
- rust
- Problem Solving
- 러스트
- ProblemSolving
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함