Can't understand the test case for Binary tree longest consecutive sequence


  • 0
    R

    How is this test case valid
    [1,null,3,2,4,null,null,null,5]

    I am under the following assumption about the above binary tree representation

    left child = 2i + 1 where i is parent
    right child = 2
    i + 2

    If this is the case, who is the parent of 2,4 ?


Log in to reply
 

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