0% found this document useful (0 votes)
13 views2 pages

Unit IV - Reconstruction of Binary Tree - Pps

Uploaded by

raghvendrac210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Unit IV - Reconstruction of Binary Tree - Pps

Uploaded by

raghvendrac210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

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

You might also like