κ·Έλν μκ³ λ¦¬μ¦Intermediate
ν¬λ£¨μ€μΉΌ μ΅μ μ μ₯ νΈλ¦¬
Union-Find μλ£ κ΅¬μ‘°λ₯Ό μ¬μ©νμ¬ κ°μ μ μ λ ¬νκ³ μνμ λ§λ€μ§ μμΌλ©΄ μΆκ°νμ¬ MSTλ₯Ό μ°Ύλ νμ μκ³ λ¦¬μ¦μ λλ€. O(E log E) 볡μ‘λλ‘ ν¬μ κ·Έλνμ μ΅μ μ λλ€. λ€νΈμν¬ μ€κ³(λͺ¨λ λ Έλλ₯Ό μ°κ²°νλ μ΅μ λΉμ©), ν΄λ¬μ€ν°λ§ μκ³ λ¦¬μ¦, νλ‘ μ€κ³μ μμ©μ΄ μμ΅λλ€. μ λ ¬κ³Ό Union-Findμ μ°μν ν΅ν©μ 보μ¬μ€λλ€.
#graph#minimum-spanning-tree#greedy#union-find
Complexity Analysis
Time (Average)
O(E log E)Expected case performance
Space
O(V)Memory requirements
Time (Best)
O(E log E)Best case performance
Time (Worst)
O(E log E)Worst case performance
π CLRS Reference
Introduction to Algorithmsβ’Chapter 23β’Section 23.2
Loading...
Implementation