推 tureday:union是根據兩個SET的elements個數大小來選擇哪一tree的樹 02/25 01:42
→ tureday:跟做為整體的樹根,較小的那個root會指向較大的root 02/25 01:44
→ tureday:FIND(i)是指搜尋路徑(由I到root)所經過的node的parent指 02/25 01:45
→ tureday:標改成指向root,用來減少find的所需時間 02/25 01:46
→ tureday:union:O(1) Find:O(logn) 02/25 01:47
→ tureday:17題第一題是ture 第二題應該是false...如果仔細去找的話 02/25 01:53
→ tureday:應該要O(n) 第3.4是O(logn)第5題應該是O(U+Flogn) 02/25 01:56
→ gpu:謝謝!!!!!!!!!! 02/25 08:07
推 davidmax1: 4.O(n) 因為最差也才n 02/25 09:05
→ davidmax1:且 union and find 有很多種組合 02/25 09:05
推 enozs:星期一再跟你解說 XD 02/26 12:22