看板 Programming 關於我們 聯絡資訊
老師講完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
MOONRAKER:搜尋關鍵字:「紅黑樹」(應該要噓的) 61.228.20.119 02/18 23:31
pponywong:這跟why應該沒有關係吧...那些是規定 140.114.207.94 02/19 00:15
pponywong:任何對樹的動作..其結果都要符合rb tree 140.114.207.94 02/19 00:16
pponywong:的規定...然後tree就會 self balance 140.114.207.94 02/19 00:16
pponywong:感覺是訂rule..有結果後再回去解釋rule 140.114.207.94 02/19 00:17
MOONRAKER:所以實在是應該要噓的 59.112.195.205 02/19 22:03