일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- easy
- 이진트리
- matrix
- 재귀
- dfs
- leetcode
- binary tree
- 미디움
- hash table
- Medium
- Binary
- 중간
- tree
- string
- math
- sorting
- 쉬움
- Array
- recursive
- 리트코드
- HashTable
- binary search
- two pointers
- 문자열
- Depth-first Search
- backtracking
- Python
- DP
- linked list
- list
- Today
- Total
목록2024/02/19 (2)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/validate-binary-search-tree/ Validate Binary Search Tree - LeetCode Can you solve this real interview question? Validate Binary Search Tree - Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: * The left subtree of a node contains only nodes with keys le leetcode.com 2. 문제 설명 주어진 tree가 이진..
데코레이터란? 파이썬에서 함수나 메소드를 감싸서 (Decorate하여), 특정 동작을 추가하거나 수정하는 기능을 말한다. 데코레이터를 사용하게 되면 코드의 재사용성을 높이고, 코드를 간결하게 유지하는 것이 가능하다. 데코레이터는 일반적으로 내부에 다른 함수를 정의하고, 그 함수를 반환하는 형태로 구현이 되는데, 이런 구조는 클로저(Closure)라 불리는 개념을 기반으로 한다. 아래의 예제를 보면, my_decorator라는 데코레이터 함수는 func이라는 인자를 받아, 그 함수를 감싸는 wrapper라는 함수를 정의하고, wrapper함수를 반환하고 있다. 이에 wrapper 함수는 클로저로써 외부함수(my_decorator)의 변수에 접근할 수 있다. @my_decorator와 같이 표시하면, 실제로..