作者sboomer (鴨子)
看板Programming
標題[問題] 資料結構中的紅黑樹問題
時間Wed Feb 18 23:09:23 2009
老師講完AVL數就沒了,
做考古題發現考了紅黑樹問題。
不知各位前輩輩可否解惑
For red-black tree
a.if a black element has only one child,that child must be a red leaf.why?
b.if a red element has any children,it must have two children and
they must be black why
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.166.59.5
1F:→ MOONRAKER:搜尋關鍵字:「紅黑樹」(應該要噓的) 61.228.20.119 02/18 23:31
2F:推 pponywong:這跟why應該沒有關係吧...那些是規定 140.114.207.94 02/19 00:15
3F:→ pponywong:任何對樹的動作..其結果都要符合rb tree 140.114.207.94 02/19 00:16
4F:→ pponywong:的規定...然後tree就會 self balance 140.114.207.94 02/19 00:16
5F:→ pponywong:感覺是訂rule..有結果後再回去解釋rule 140.114.207.94 02/19 00:17
6F:→ MOONRAKER:所以實在是應該要噓的 59.112.195.205 02/19 22:03