일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Python
- Regular Expression
- 밴픽
- Python Implementation
- 컴퓨터의 구조
- 운영체제
- Python Code
- kaggle
- concurrency
- 315. Count of Smaller Numbers After Self
- 프로그래머스
- Generator
- iterator
- t1
- 715. Range Module
- 109. Convert Sorted List to Binary Search Tree
- shiba
- 시바견
- 43. Multiply Strings
- Decorator
- attribute
- LeetCode
- Protocol
- 30. Substring with Concatenation of All Words
- 파이썬
- Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- data science
- Class
- DWG
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