Is {1,2,3,3,#,2,#} such a tree?


  • 1
    X

    i am wondering whether my understanding is correct:

          1
        /    \
       2    3
      /      /
     3     2

  • 1

    Yes, your drawing is correct.

    From OJ's Binary Tree Serialization:

    The serialization of a binary tree follows a level order traversal, where '#' signifies a path terminator where no node exists below.

Log in to reply
 

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