일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 중간
- dfs
- list
- backtracking
- 이진트리
- linked list
- 미디움
- math
- Binary
- matrix
- 리트코드
- Depth-first Search
- recursive
- two pointers
- easy
- tree
- string
- binary tree
- 재귀
- sorting
- leetcode
- hash table
- 쉬움
- DP
- HashTable
- Python
- Array
- Medium
- binary search
- 문자열
- Today
- Total
목록binary tree (14)
부부의 코딩 성장 일기
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. 문제 링크 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. 문제 설명 오름차순으..
1. 문제 링크 https://leetcode.com/problems/maximum-depth-of-binary-tree/ Number of 1 Bits - LeetCode Can you solve this real interview question? Number of 1 Bits - Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight [http://en.wikipedia.org/wiki/Hamming_w leetcode.com 2. 문제 설명 이진 트리 root가 주어졌을 때, 최대 ..
1. 문제 링크 https://leetcode.com/problems/same-tree/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com 2. 문제 설명 이진 트리 p, q가 주어졌을 때, 두 트리가 같은 tree인지 판단 같다의 정의: 구조..
1. 문제 링크 Binary Tree Inorder Traversal - LeetCode Binary Tree Inorder Traversal - LeetCode Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1,nu leetcode.com 2. 문제 설명 이진 트리가 주어졌을 때 중위 순회(inorder tra..