看板 Grad-ProbAsk 關於我們 聯絡資訊
If both weighting rule and collapsing rule are applied, what is the time required for a sequence of n-1 Unions and m Finds 我的解法是 Union : O(1) , n-1 個 : O(n) Find : O(log*n) , m 個 : O(m) 答案: O(n+m) 這樣對嗎~? 還是只要寫O(n)? -- ┌這?─────────────────────────────┐ │ │ 一"一 \ / >\\\< ╯ ╰ ∩ ∩ ▁ ▁_< ㄧ ㄧ+ │ ε Δ ╰╯ 北七 亂喔 害羞 莎笅 爽啦 哭爸 XD 科科 └──────────────────────────────────────┘ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.14.2
FRAXIS:O(n + m) 12/18 12:32