[理工] [資結] 前後序求中序
請問下面這一題(99成大電機)是否有辦法求出唯一解 ?
Assume the preorder t raversal of a binary tree is "L, J, B, A, C, G, D, E, K,
I, F, H" and the postorder traversal of the same tree is "A, C, B, D, E, G, J
F, H, I, K, L". Also, assume that the subtree with J as root is a full binary
tree and J is the root of L's left subtree. Hence, K is the root of L's right
subtree and I the root of K's right subtree. Will you be able to uniquely
define the tree ? If yes, please draw the binary tree. If no, please indicate
how many distinct binary trees can be derived.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.233.169.131
→
02/05 22:33, , 1F
02/05 22:33, 1F
→
02/05 22:35, , 2F
02/05 22:35, 2F
→
02/05 22:36, , 3F
02/05 22:36, 3F
→
02/05 22:36, , 4F
02/05 22:36, 4F
討論串 (同標題文章)