2 votes 2 votes Is it possible to construct multiple binary from given preorder and postorder? Sahil Raza asked Sep 27, 2018 Sahil Raza 327 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 4 votes 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 See all 4 4 Comments reply Sahil Raza commented Sep 27, 2018 reply Follow Share thank u 0 votes 0 votes Shaik Masthan commented Sep 27, 2018 reply Follow Share @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 votes 2 votes Prince Sindhiya commented Sep 27, 2018 reply Follow Share Ok Shaikh sir , i got it and yes you are right Thnxx :) 0 votes 0 votes Shaik Masthan commented Sep 27, 2018 reply Follow Share @Prince Sindhiya No need to call me sir ! 0 votes 0 votes Please log in or register to add a comment.