Binary Tree Representation


  • 1
    W

    I am trying to debug my code. Now I got an error.

    Input: {1,2,3,4,5,#,6,7,#,#,#,#,8}

    Output: {1,#,2,3,#,4,5,6,#,7,#}

    Expected: {1,#,2,3,#,4,5,6,#,7,8,#}

    Anyone knows what's the shape of the input and output trees. Anywhere that I may find the specification of the representations?


  • 2
    S

    Open the spoiler in it.


Log in to reply
 

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