일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Protocol
- Generator
- Class
- concurrency
- kaggle
- Convert Sorted List to Binary Search Tree
- Regular Expression
- DWG
- Decorator
- LeetCode
- 315. Count of Smaller Numbers After Self
- 715. Range Module
- Substring with Concatenation of All Words
- t1
- Python Implementation
- 컴퓨터의 구조
- data science
- shiba
- attribute
- Python
- Python Code
- iterator
- 30. Substring with Concatenation of All Words
- 운영체제
- 프로그래머스
- 43. Multiply Strings
- 파이썬
- 밴픽
- 시바견
- 109. Convert Sorted List to Binary Search Tree
Archives
- Today
- Total
목록Construct Binary Tree from Preorder and Inorder Traversal (1)
Scribbling
LeetCode: 105. Construct Binary Tree from Preorder and Inorder Traversal
재귀로 풀어주자 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def buildTree(self, preorder: List[int], inorder: List[int]) -> Optional[TreeNode]: return self.builder(preorder, inorder) def builder(self, preorder, inorder): if not preorder: return None head = TreeNode(val..
Computer Science/Coding Test
2021. 10. 20. 16:42