일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Class
- Convert Sorted List to Binary Search Tree
- Decorator
- Generator
- 43. Multiply Strings
- concurrency
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- 715. Range Module
- iterator
- 315. Count of Smaller Numbers After Self
- attribute
- 운영체제
- 파이썬
- 밴픽
- shiba
- 30. Substring with Concatenation of All Words
- 프로그래머스
- data science
- Protocol
- 컴퓨터의 구조
- Python
- LeetCode
- Python Code
- t1
- Substring with Concatenation of All Words
- Python Implementation
- DWG
- Regular Expression
- 시바견
Archives
- Today
- Total
목록kruskal (1)
Scribbling
신장 트리, 최소 신장 트리, Kruskal Algorithm
1. 신장 트리: 모든 node를 포함하면서 cycle이 존재하지 않는 그래프를 의미한다. 2. 최소 신장 트리: 신장 트리 중에서 최소 비용으로 만들 수 있는 트리 3. Kruskal Algorithm: 최소 신장 트리를 찾는 알고리즘 - O(vlogv) - Greedy하게 최소 비용 edge부터 차례로 연결한다. - 연결하고자 하는 node가 서로소였다면, union을 진행 - 연결하고자 하는 node가 cycle을만든다면, pass def find_parent(parent, x): if parent[x] == x: return x parent[x] = find_parent(parent, parent[x]) return parent[x] def union(parent, a, b): a = find_p..
Computer Science/Algorithms & Data Structures
2021. 8. 13. 22:43