Help,what the standard answer is?And how the tree organize?


  • 1
    B

    Input: 2
    Output: [{1,2},{1,#,2}]
    Expected: [{1,#,2},{2,1}]
    .i'm confused with the expected.Is the answer is th unique?i think the struct of the tree is right,
    but the order is wrong. i want to ask what is the standard answer.thanks:)


  • 1
    S

    Note that the question asks for binary SEARCH trees, which means every node must be greater than its left child and less than the right one. Therefore, by definition, {1, 2} in your output is NOT a binary search tree.


  • 0
    B

    thanks a lot!


Log in to reply
 

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