Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 이분 탐색
- 문자열
- 누적 합
- 투 포인터
- 그리디
- 수학
- 슬라이딩 윈도우
- 에라토스테네스의 체
- 트리
- 정수론
- 구현
- 2357
- 정렬
- 싸피
- 맵
- DFS
- 그래프
- 모던 JavaScript 튜토리얼
- Python
- boj
- 해시 테이블
- JavaScript
- 플로이드-워셜
- 브루트포스
- DP
- 애드 혹
- 13164
- SSAFY
- 세그먼트 트리
- BFS
Archives
- Today
- Total
목록트라이 (1)
흙금이네 블로그

아이디어 14725번 개미굴과 비슷한 문제로, 트라이를 이용해 디렉토리 구조를 출력한다. 풀이 #1 (Python) import sys input = sys.stdin.readline class Trie(): def __init__(self): self.root = dict() def insert(self, directories): node = self.root for directory in directories: if directory not in node: node[directory] = dict() node = node[directory] def search(self): def dfs(node, d): for directory in sorted(node.keys()): res.append(' '*d..
알고리즘
2023. 5. 23. 23:47