Question regarding the task definition


  • 0
    K

    How is this a 'false'?

    [10,5,15,null,null,6,20]

    10 has two children 5 and 15 (left and right), 5 has no children, 15 has two children 6 and 20.

    From the definition:

    
    The left subtree of a node contains only nodes with keys less than the node's key.
    The right subtree of a node contains only nodes with keys greater than the node's key.
    Both the left and right subtrees must also be binary search trees.
    

    From my understanding this is a perfectly fine tree up there.


Log in to reply
 

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