作者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