It depends on what traversals are given. If one of the traversal methods is Inorder then the tree can be constructed, otherwise not.
Therefore, following combination can uniquely identify a tree.
Inorder and Preorder.
Inorder and Postorder.
Inorder and Level-order.
And following do not.
Postorder and Preorder.
Preorder and Level-order.
Postorder and Level-order.
For example, Preorder, Level-order and Postorder traversals are same for the trees given in above diagram.
Preorder Traversal = AB
Postorder Traversal = BA
Level-Order Traversal = AB
So, even if three of them (Pre, Post and Level) are given, the tree can not be constructed.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Construct Full Binary Tree using its Preorder traversal and Preorder traversal of its mirror tree
- Construct Special Binary Tree from given Inorder traversal
- Level order traversal of Binary Tree using Morris Traversal
- Construct a Maximum Binary Tree from two given Binary Trees
- Construct a special tree from given preorder traversal
- Check if a binary tree is subtree of another binary tree using preorder traversal : Iterative
- Check if a given array can represent Preorder Traversal of Binary Search Tree
- Check if the given array can represent Level Order Traversal of Binary Search Tree
- Construct XOR tree by Given leaf nodes of Perfect Binary Tree
- Construct the full k-ary tree from its preorder traversal
- Construct the Rooted tree by using start and finish time of its DFS traversal
- Given level order traversal of a Binary Tree, check if the Tree is a Min-Heap
- Construct BST from given preorder traversal | Set 2
- Construct BST from its given level order traversal
- Construct a BST from given postorder traversal using Stack
- Construct BST from its given level order traversal | Set-2
- Find parent of given node in a Binary Tree with given postorder traversal
- Complexity of different operations in Binary tree, Binary Search Tree and AVL tree
- Construct Binary Tree from given Parent Array representation
- Construct a Binary Search Tree from given postorder