作者Quietlake (ekalteiuQ)
看板Grad-ProbAsk
標題Re: [理工] [DS] 台大電機100
時間Tue Feb 14 11:01:43 2012
※ 引述《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
1F:→ onlyeric23:實際case我也想不到 不過AVL較嚴格 高度小於等於紅黑 02/14 11:31
2F:→ onlyeric23:應該是在wiki看到的 02/14 11:32
3F:→ onlyeric23:恩...高度可能有問題 待查 02/14 11:35
4F:→ Quietlake:我也有看到維基這段,但不是很確定,所以再來問看看 02/14 11:39
5F:→ n60119:HOROWITZ版 P508最上面 可以當作原因嗎? 02/14 11:46
6F:→ Quietlake:手上沒有這本書,可以簡單打一下內容嗎? 02/14 14:52
7F:→ n60119:the worst-case height of a red-black tree is more than 02/14 15:58
8F:→ n60119:the worst-case height of an AVL tree with the same 02/14 15:59
9F:→ n60119: number of (internal) nodes. 02/14 15:59
10F:→ n60119:可以當作可當作原因嗎? 因為這是worst-case的時候 02/14 16:00
11F:→ onlyeric23:應該ok吧 02/14 16:05
12F:→ onlyeric23:看到internal才想到 紅黑是extend 沒說只管internal 02/14 16:06
13F:→ onlyeric23:隨便都比較高吧lol 02/14 16:07
14F:推 bbhands:try this sequence: 1, 2, 3, 4, 5, 6 02/14 16:10
15F:推 zensword:紅黑樹可以弄出在AVL中是不屬於balance的情形 02/14 18:10
16F:推 zensword:用1 2 3 4 5 6就可以看出來了 02/14 18:17
17F:推 zensword:原來bbhands已經講了XDD 02/14 18:20
19F:推 onlyeric23:對耶 囧 感謝 02/14 18:24