2 2 votes Is it possible to construct multiple binary from given preorder and postorder? Data Structures + – Sahil Raza 827 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 4 4 votes Before some days I also had same doubt Yes multiple binary trees possible With preorder and postorder, we can't create a unique binary tree. There will be ambiguity and multiple trees can exist. For example, Prince Sindhiya answered Sep 27, 2018 • selected Sep 27, 2018 by Shaik Masthan Prince Sindhiya comment Share Follow See all 4 Comments 4 4 Comments reply Sahil Raza commented Sep 27, 2018 reply Follow flag thank u 0 0 replyShare Shaik Masthan commented Sep 27, 2018 reply Follow flag @Prince Sindhiya yes, what you have did is correct.( if You know, then just ignore. ) But note that, " Is it possible to construct multiple binary from given preorder and postorder? " it is possible only, if a node have only one child. if every node is either having either 2 childs or 0 childs, then you can't have multiple Binary Tree from given preorder and postorder. 2 2 replyShare Prince Sindhiya commented Sep 27, 2018 reply Follow flag Ok Shaikh sir , i got it and yes you are right Thnxx :) 0 0 replyShare Shaik Masthan commented Sep 27, 2018 reply Follow flag @Prince Sindhiya No need to call me sir ! 0 0 replyShare Please log in or register to add a comment.