Don't understand a test case [1,3,2], [3,2,1]


  • 0
    H

    Submission Result: Runtime Error
    Last executed input: [1,3,2], [3,2,1]

          3                         3
        /    \                     /    \
       1    2                   2     1
    

    from [1,3,2], the tree should be
    3
    / \
    1 2
    from [3,2,1], the tree should be:
    3
    /
    2 1
    Did I miss something?


  • 0
    L

    You can't decide a tree only by the in-order-traversal or post-order-traversal. For a single tree traversal, there may be multiple results.


Log in to reply
 

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