일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 리트코드
- leetcode
- 중간
- backtracking
- Binary
- binary tree
- easy
- math
- sorting
- 재귀
- 이진트리
- HashTable
- 쉬움
- dfs
- Python
- list
- binary search
- Medium
- tree
- DP
- two pointers
- Depth-first Search
- recursive
- 문자열
- matrix
- string
- 미디움
- Array
- linked list
- hash table
- Today
- Total
목록2024/02/24 (2)
부부의 코딩 성장 일기
Python에서 packages를 만들게 되면, __init__.py를 포함하게 된다. 다들 그렇게 코드를 작성하길래, 왜 필요한지 모른 채 그냥 __init__.py를 추가했었다. 그러다가, __init__.py를 추가하지 않고, 해당 packages를 import해서 불러오려고 하다보니, modules를 찾을 수 없다는 에러가 떴고, 그 원인이 바로 __init__.py였다 __init__.py의 역할은? __init__.py 파일은 python 패키지를 정의하는 데에 사용되는 파일이다. 주요 역할은 아래와 같은데, 1. 패키지 식별자로 사용 __init__.py 파일이 있는 디렉토리는 Python에게 패키지로 취급되어야 함을 알린다. 즉, 이 파일이 없다면 해당 디렉토리는 단순한 모듈 디렉토리로 간..

1. 문제 링크 https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 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. 문제 설명 preorder, inorder에 대한 array가 주어졌을 때, 여기서 preorder는 이진트리의 preorder tr..