看板 Grad-ProbAsk 關於我們 聯絡資訊
Assume that a node to be deleted is replaced by the largest integer of its left subtree.Please delete 85 from it and draw the resulting B-tree.Note that a node always considers its right sibling first for combination. 45 , 85 / | \ 15,25 70 90 刪除 85後: 我的是: 25 , 70 / | \ 15 45 90 我看解答是說: 25 , 70 45 / | \ / \ 15 45 90 和 15,25 70,90 皆可 但我看題目最後有 Note that a node always considers its right sibling first for combination. 教授 是希望我們寫: 45 / \ 15,25 70,90 這個答案嗎? 拜託了 -- 一切.... 似乎不再那麼重要.... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.230.3.167
assassin88:我也會寫右邊答案 03/23 22:36
lineageorc:兩個都寫最好 就跟二元搜尋樹一樣 會有兩棵樹 03/23 23:01
lineageorc:note 只是說 有需要"合併"時 優先挑右兄弟 03/23 23:02
lineageorc:沒有說 是要從左邊最小值 還是右邊最大值 來替代 03/23 23:04