+ 20
Is there a binary tree whose post order and pre order traversals are same??
6 Antworten
+ 9
in tree traversal technique for preorder we have to first start traversing from root left node and right node whereas in post order first we have to visit left and right node than root so the sequence of traversal is different
+ 7
maybe anything is possible
+ 2
It is not possible to tree whose preorder and postorder traversal are same. Because sequence of both are different in manner.
There is only condition where preorder and postorder are same that is tree with single node.(i.e. Tree has only one node(root node))
+ 1
If binary tree follows following condition then pre-order and post-order traversals of tree are same.
1. For each node in a tree, left subtree is mirror copy of right subtree and vice versa.
2. If tree is skew-symmetric tree either left skew-symmetric or right.
0
It is possible in 2 cases
case 1: if the tree contains single node.
case 2: if the tree contains duplicates in it
except in the above 2 cases post order and pre order traversals are not same
0
1. A
/
B
/
C
/
D
Inorder=DCBA
POSTORDER=DCBA