看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《LADMCODS (我要上112)》之銘言: : http://exam.lib.ntu.edu.tw/sites/default/files/exam/graduate/100/100412.pdf : 我想問第10題的A選項 : the number of rotations per insert/delete operation in a red-black tree : is O(log n) : 毫無頭緒 不知道要不要選 @@ : 先謝過了! 看到推文的各位都是選CDE,想請教一下B選項, 不是很清楚二者的高度誰大誰小,因為都是balanced, 白痴的試了好幾串data,二個建出來的高度都一樣... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.169.183.107
onlyeric23:實際case我也想不到 不過AVL較嚴格 高度小於等於紅黑 02/14 11:31
onlyeric23:應該是在wiki看到的 02/14 11:32
onlyeric23:恩...高度可能有問題 待查 02/14 11:35
Quietlake:我也有看到維基這段,但不是很確定,所以再來問看看 02/14 11:39
n60119:HOROWITZ版 P508最上面 可以當作原因嗎? 02/14 11:46
Quietlake:手上沒有這本書,可以簡單打一下內容嗎? 02/14 14:52
n60119:the worst-case height of a red-black tree is more than 02/14 15:58
n60119:the worst-case height of an AVL tree with the same 02/14 15:59
n60119: number of (internal) nodes. 02/14 15:59
n60119:可以當作可當作原因嗎? 因為這是worst-case的時候 02/14 16:00
onlyeric23:應該ok吧 02/14 16:05
onlyeric23:看到internal才想到 紅黑是extend 沒說只管internal 02/14 16:06
onlyeric23:隨便都比較高吧lol 02/14 16:07
bbhands:try this sequence: 1, 2, 3, 4, 5, 6 02/14 16:10
zensword:紅黑樹可以弄出在AVL中是不屬於balance的情形 02/14 18:10
zensword:用1 2 3 4 5 6就可以看出來了 02/14 18:17
zensword:原來bbhands已經講了XDD 02/14 18:20
onlyeric23:對耶 囧 感謝 02/14 18:24
sneak: 原來bbhands已經 https://daxiv.com 09/11 14:56