[問題] 資料結構中的紅黑樹問題

看板Programming作者 (鴨子)時間15年前 (2009/02/18 23:09), 編輯推噓1(105)
留言6則, 2人參與, 最新討論串1/1
老師講完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

02/18 23:31, , 1F
搜尋關鍵字:「紅黑樹」(應該要噓的)
02/18 23:31, 1F

02/19 00:15, , 2F
這跟why應該沒有關係吧...那些是規定
02/19 00:15, 2F

02/19 00:16, , 3F
任何對樹的動作..其結果都要符合rb tree
02/19 00:16, 3F

02/19 00:16, , 4F
的規定...然後tree就會 self balance
02/19 00:16, 4F

02/19 00:17, , 5F
感覺是訂rule..有結果後再回去解釋rule
02/19 00:17, 5F

02/19 22:03, , 6F
所以實在是應該要噓的
02/19 22:03, 6F
文章代碼(AID): #19d2IaNu (Programming)