How will the tree look like in this case?

  • 0

    I am getting wrong answer for this input -


    But I am not able to figure out how the tree will look like for this case. Can anyone please help me with a drawing.

  • 0

    node [2i] is left child of node[i],node [2i+1] is right child of node[i],so the tree looks like this:

    /    \

    2 ------- 4


Log in to reply

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