###### tags: `DSA` #### Kruskal's Algorithm 1. 將邊的權重排序,每個點視為一個MSS(最小生成子樹) 2. 從最小權重邊的點將兩個子樹相連,若產生環,捨棄此邊 3. LOOP time: O(**ElogE** or **ElogV**) #### Prim's Algorithm 概念:Shortest Path: Dijkstra's Algorithm(找不在樹上、離根最近的點) 差別: 找不在樹上、離樹最近的點 time: O(V^2)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up