Is there a binary tree whose post order and pre order traversals are same??
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
maybe anything is possible
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))
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.
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
1. A / B / C / D Inorder=DCBA POSTORDER=DCBA