Open In App

GFact | How to construct Binary Tree and Binary Search Trees?

Last Updated : 17 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

To uniquely construct a Binary Tree, Inorder together with either Postorder or Preorder must be given (See this for details). However, either Postorder or Preorder traversal is sufficient to uniquely construct a Binary Search Tree. To construct Binary Search tree, we can get Inorder traversal by sorting the given Preorder or Postorder traversal. So we have the required two traversals and can construct the Binary Search Tree.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads