作者nonagoner (哈)
看板Grad-ProbAsk
標題[理工] [資結]-二元樹追蹤
時間Fri Feb 5 21:39:18 2010
If the inorder traversal of T yields GOODBOOK, and the postorder
traversal of T yields GOOOBKOD.
What is the preorder traversal of T?
我算出有2顆樹,請問有沒有問題呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.141.106
1F:推 tureday:我畫的是 D 02/05 21:57
2F:推 lovefo:前(後)序 + 中序 不是可以決定唯一樹嗎? 02/05 21:57
3F:→ tureday: / \ 02/05 21:58
4F:→ tureday: O O 02/05 21:58
5F:→ tureday: / \ / \ 02/05 21:59
6F:→ tureday: G O B K 02/05 22:00
7F:→ tureday: \ 02/05 22:00
8F:→ tureday: O 就像l大說的可以決定唯一 02/05 22:01
9F:→ taitin:被斷頭XD 2F 在distinct的時候才唯一 02/05 22:02
10F:推 tureday:哎呀 我搞錯了... 02/05 22:05