| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- recursive
- 이진트리
- dfs
- 재귀
- tree
- leetcode
- 리트코드
- linked list
- Medium
- 미디움
- Binary
- math
- 쉬움
- binary search
- 문자열
- sorting
- matrix
- binary tree
- Array
- hash table
- Depth-first Search
- easy
- Python
- string
- list
- backtracking
- DP
- 중간
- two pointers
- HashTable
- Today
- Total
목록immutable (2)
부부의 코딩 성장 일기
얕은 복사란? 원본 객체의 요소들을 새로운 객체로 복사하지만, 내부에 있는 객체들은 참조로 복사 내부 객체는 그래서 동일한 객체를 가리키게 됨 아래 예제를 보면 단순히 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,..
1. 문제 링크 https://leetcode.com/problems/merge-two-sorted-lists/ Merge Two Sorted Lists - LeetCode Can you solve this real interview question? Merge Two Sorted Lists - You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists leetcode.com 2. 문제 설명 linked list 두 개가 주어졌을 ..