看板 Grad-ProbAsk 關於我們 聯絡資訊
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