[理工] [資結]-交大95-工工

看板Grad-ProbAsk作者 (木頭)時間15年前 (2010/10/25 15:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
Find all binary trees whose nodes appear in exactly the same sequence in both (1) preorder and inorder (2) preorder and postorder (3) inorder and postorder ans: 1. 空tree, Root 1個點, 右歪斜的二元樹 2. 空tree, Root 1個點 3. 空tree, Root 1個點, 左歪斜的二元樹 我看不懂解答的意思 我想法是 2.給前序跟後序無法決定唯一的B.T -->OK 1.給前序跟中序可以決定唯一的B.T,但為什麼說是空的樹呢, 而且還有有辦法保證右歪斜嗎? 3.給中序跟後序也為什麼可以是左歪斜呢 請問有例子可舉嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.251.200.33
文章代碼(AID): #1CnJGSs9 (Grad-ProbAsk)
文章代碼(AID): #1CnJGSs9 (Grad-ProbAsk)