일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Medium
- math
- 미디움
- matrix
- easy
- HashTable
- 문자열
- 쉬움
- 중간
- two pointers
- Binary
- 이진트리
- list
- leetcode
- linked list
- hash table
- dfs
- tree
- backtracking
- Array
- DP
- 재귀
- string
- recursive
- binary tree
- Depth-first Search
- sorting
- binary search
- Python
- 리트코드
- Today
- Total
목록2024/02/18 (2)
부부의 코딩 성장 일기

1. 문제 링크 https://leetcode.com/problems/binary-tree-paths/description/ 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 tree의 root가 주어졌을 때, root부터 leaf까지 가는 모든 paths를 list에 append하여 반환 여기서 leaf란 children이 없는 n..
얕은 복사란? 원본 객체의 요소들을 새로운 객체로 복사하지만, 내부에 있는 객체들은 참조로 복사 내부 객체는 그래서 동일한 객체를 가리키게 됨 아래 예제를 보면 단순히 list를 copy한 후, 기존 리스트(original_list)를 변경하면, 얕은 복사를 한 shallow_copy도 값이 변하게 됨. "내부 객체가 동일한 객체 - 같은 주소"를 가리키고 있기 때문! original_list = [1, [2, 3], 4] shallow_copy = original_list.copy() # 얕은 복사 후 내부 리스트의 참조는 동일함 original_list[1][0] = 99 print(original_list) # 출력: [1, [99, 3], 4] print(shallow_copy) # 출력: [1,..