Reconstruction of Binary
Tree
The original tree cannot be reconstructed,
given its inorder, preorder or postorder
traversal alone.
If sequence of nodes produced by inorder
and postorder traversal of a binary tree are
provided then a unique binary tree can be
reconstructed.
Trees Unit III. 1 Dr. Rabins Porwal
Example
Inorder: HDIJEKBALFMCNGO
Postorder: HIDJKEBLMFNOGCA
A
HDIJEKB LFMCNGO
B C
HIDJKEB LMFNOGC
HDIJEK LFM NGO
E F G
HIDJKE LMF NOG
HDIJ K L M N O
J K
HIDJ K
HDI
D
HID
H I
Trees Unit III. 2 Dr. Rabins Porwal