If you are given two traversal sequences, can you construct the binary tree? Last Updated : 15 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Comment More infoAdvertise with us Next Article If you are given two traversal sequences, can you construct the binary tree? K kartik Follow Improve Article Tags : Tree DSA Binary Tree tree-traversal Practice Tags : Tree Similar Reads Construct a Perfect Binary Tree from Preorder Traversal Given an array pre[], representing the Preorder traversal of a Perfect Binary Tree consisting of N nodes, the task is to construct a Perfect Binary Tree from the given Preorder Traversal and return the root of the tree. Examples: Input: pre[] = {1, 2, 4, 5, 3, 6, 7}Output: 1 / \ / \ 2 3 / \ / \ / \ 11 min read Check if the given array can represent Level Order Traversal of Binary Search Tree Given an array of size n. The task is to check whether the given array can represent the level order traversal of a Binary Search Tree or not.Examples: Input: arr[] = {7, 4, 12, 3, 6, 8, 1, 5, 10}Output: TrueExplanation: For the given arr[] the Binary Search Tree is: Input: arr[] = {11, 6, 13, 5, 12 9 min read Construct a Maximum Binary Tree from two given Binary Trees Given two Binary Trees, the task is to create a Maximum Binary Tree from the two given binary trees and print the Inorder Traversal of that tree. What is the maximum Binary Tree? The maximum binary is constructed in the following manner: In the case of both the Binary Trees having two corresponding 8 min read Construct Full Binary Tree from given preorder and postorder traversals Given two arrays that represent preorder and postorder traversals of a full binary tree, construct the binary tree. Full Binary Tree is a binary tree where every node has either 0 or 2 children.Examples of Full Trees. Input: pre[] = [1, 2, 4, 8, 9, 5, 3, 6, 7] , post[] = [8, 9, 4, 5, 2, 6, 7, 3, 1]O 9 min read Check if given inorder and preorder traversals are valid for any Binary Tree without building the tree cGiven two arrays pre[] and in[] representing the preorder and inorder traversal of the binary tree, the task is to check if the given traversals are valid for any binary tree or not without building the tree. If it is possible, then print Yes. Otherwise, print No. Examples: Input: pre[] = {1, 2, 4, 15+ min read Like