κ·Έλž˜ν”„ μ•Œκ³ λ¦¬μ¦˜Intermediate

ν”„λ¦Ό μ•Œκ³ λ¦¬μ¦˜

μ‹œμž‘ μ •μ μ—μ„œ 트리λ₯Ό μ„±μž₯μ‹œμΌœ μ΅œμ†Œ μ‹ μž₯ 트리(MST)λ₯Ό μ°ΎλŠ” μ•Œκ³ λ¦¬μ¦˜μž…λ‹ˆλ‹€. 항상 트리 λ‚΄λΆ€ 정점과 μ™ΈλΆ€ 정점을 μ—°κ²°ν•˜λŠ” μ΅œμ†Œ κ°€μ€‘μΉ˜ 간선을 μΆ”κ°€ν•©λ‹ˆλ‹€. 효율적인 κ°„μ„  선택을 μœ„ν•΄ μš°μ„ μˆœμœ„ 큐λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€. λ°€μ§‘ κ·Έλž˜ν”„μ— μ΄μƒμ μž…λ‹ˆλ‹€.

#graph#mst#greedy#priority-queue

Complexity Analysis

Time (Average)

O(E log V)

Expected case performance

Space

O(V)

Memory requirements

Time (Best)

O(E log V)

Best case performance

Time (Worst)

O(E log V)

Worst case performance

πŸ“š CLRS Reference

Introduction to Algorithmsβ€’Chapter 23β€’Section 23.2

Presets:
Step: 1 / 0
500ms
SlowFast
Keyboard Shortcuts
Space Play/Pause← β†’ StepR Reset1-4 Speed

Real-time Statistics

Algorithm Performance Metrics

Progress0%
Comparisons
0
Swaps
0
Array Accesses
0
Steps
1/ 0

Algorithm Visualization

Step 1 of 0

Initialize array to begin

Default
Comparing
Swapped
Sorted

Code Execution

Currently executing
Previously executed

Implementation

Prim's Algorithm - Algorithm Vision