일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- two pointers
- easy
- DP
- matrix
- binary search
- math
- string
- Array
- 중간
- Binary
- Python
- linked list
- tree
- 문자열
- leetcode
- HashTable
- Medium
- 리트코드
- 미디움
- sorting
- hash table
- binary tree
- Depth-first Search
- recursive
- 쉬움
- 재귀
- dfs
- backtracking
- list
- 이진트리
- Today
- Total
목록tree (19)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/count-complete-tree-nodes/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 2. 문제 설명 주어진 완전 이진 트리의 노드 개수를 반환하는 문제 완전 이진 트리란 마지막 레벨을 제외한 모든 레벨에서 노드가 왼쪽에서 오른쪽으로 채워진 이진 트리를 의미, 모든 레벨의 노드는 ..
1. 문제 링크 Unique Binary Search Trees II - LeetCode LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 2. 문제 설명 이진 검색 트리(Binary Search Tree, BST)의 뜻 각 노드의 값이 왼쪽 서브트리에 있는 모든 노드의 값보다 작고, 오른쪽 서브트리에 있는 모든 노드의 값보다 크다 n이 주어졌을 때 1부터 n까..
1. 문제 링크 https://leetcode.com/problems/binary-tree-preorder-traversal/ Binary Tree Preorder Traversal - LeetCode Can you solve this real interview question? Binary Tree Preorder Traversal - Given the root of a binary tree, return the preorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1, leetcode.com 2. 문제 설명 이진 트리의 r..
1. 문제 링크 Binary Tree Postorder Traversal - LeetCode Binary Tree Postorder Traversal - LeetCodeCan you solve this real interview question? Binary Tree Postorder Traversal - Given the root of a binary tree, return the postorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/08/28/pre1.jpg] Input: root = [1,nuleetcode.com2. 문제 설명 트리 순회 위키피디아 트리 순회 - 위키백과, 우리 모두..
1. 문제 링크 https://leetcode.com/problems/path-sum/ Path Sum - LeetCode Can you solve this real interview question? Path Sum - Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a node with no ch leetcode.com 2. 문제 설명 이진 트리 root와, 정수 targetSum가 주어졌을 때, root에서 leaf로 이어..
1. 문제 링크 Minimum Depth of Binary Tree - LeetCode Minimum Depth of Binary Tree - LeetCode Can you solve this real interview question? Minimum Depth of Binary Tree - Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a no leetcode.com 2. 문제 설명 이진 트리 구조가 주어졌을 때 Minimum Depth를..
1. 문제 링크 https://leetcode.com/problems/balanced-binary-tree/ 2. 문제 설명 이진트리가 주어질 때, 이 트리가 height-balanced 되있는지에 따른 boolean을 반환 height-balanced의 정의 모든 노드의 두개의 subtree의 depth가 1개보다 더 차이나지 않는 이진트리 예시1) 아래 트리의 경우 루트 노드 3에 대해 subtree의 depth가 왼쪽 오른쪽 각각 1, 2이고 노드 9는 0,0, 노드 20은 각각 1,1로 depth가 1보다 더 차이나는 게 없으므로 True를 반환 3 / \ 9 20 / \ 15 7 예시2) 아래 트리의 경우 루트노드 1에 대해 subtree의 depth가 왼쪽 3, 오른쪽 1이기 때문에 1보다 더..
1. 문제 링크 Convert Sorted Array to Binary Search Tree - LeetCode Convert Sorted Array to Binary Search Tree - LeetCode Can you solve this real interview question? Convert Sorted Array to Binary Search Tree - Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. Example 1: [https://assets.leetcod leetcode.com 2. 문제 설명 오름차순으..