作者ilikesg (SG )
看板Grad-ProbAsk
標題[理工][資結] 有關二元樹的問題
時間Tue Jan 11 11:53:13 2011
If the preorder or a binary tree is ABCDEFGHI
, and the inorder representation is BDCAFHGEI,
What is the original binary tree?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 115.43.41.89
→ weiyung:請排版高手來畫圖解釋這題~ 01/11 12:20
推 boy5548:可以由preorder知道哪個點是root(DLR),找到root後,在根 01/11 16:11
→ boy5548:據inorder來分左右子樹,遞迴做下去就可以了 01/11 16:12