Confusion about the binary tree interface of this question


  • 0
    V

    How can we know the binary tree interface? Or what methods does TreeNode have?

    For instance, if t is an object/instance of TreeNode, and we want to check if t is root, then which version below is correct?

    t.isRoot()
    t.is_root()
    t.root()
    ...

    and how to access value of t?

    t.get_value()
    t.value()
    t.val
    ...

    which one is correct?


Log in to reply
 

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