Is the corresponding binary tree unique when given the preorder serialization?


  • 0
    X

    As we all know, the corresponding binary tree is not unique when given the preorder serialization(without '#' to represent null), now we got the '#'s in this question, it seems that the structure of the tree is becoming unique, isn't it? Can anyone give a proof or counter-example about it?


  • 0
    X

    I found a proof using mathematical induction myself, problem solved.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.