[理工] 紅黑樹

作者: PTTleader (PTT領導)   2016-11-14 22:13:27
http://imgur.com/a/oFpgR
右邊那個樹
是紅黑樹嗎
紅黑樹是balanced tree
可是我感覺它不是balanced tree
還是我搞錯定義了
balanced tree 的定義是什麼?
作者: ken52011219 (呱)   2016-11-14 22:25:00
紅黑樹的Balabce是看 black 是否一樣高無關子樹的高度是否一樣
作者: aa06697 (todo se andarà)   2016-11-15 16:41:00
洪逸上課有說紅黑樹balance不是指本身balance 是指對應回去的234tree balance另外wiki: The balancing of the tree is not perfect, but it is good enough to allow it to guarantee searching in O(log n) time

Links booklink

Contact Us: admin [ a t ] ucptt.com