It is determined by the binary tree traversal method

:( satisfy the condition)

1. At least two traversals
2 must be preorder

It is determined by the traversal of a binary tree in preorder traversal order and

May be determined by a preorder traversal of the root node first, then combined to determine preorder left subtree and right subtree, then preorder traversal manner were left subtree root node and the right child of the number, and then were determined left and right sub-tree root, combined preorder determine left and right subtrees subtree, this recursion and eventually finished traversing all the elements, you can determine the binary tree.
(By the same subsequent traversal and inorder traversal thought)

Analysis examples

1.
Known preorder traversal of the binary tree (also called preorder) sequence ABDCEFG , sequence preorder DBCAFEG , after the sequence preorder _____.
Answer: DCBFGEA
Here Insert Picture Description
2.
Let T be a non-null binary tree, and sequence preorder traversal, if the same sequence as T, the T form is ___. If preorder and postorder traversal same T, the T form is __. And if the preorder traversal subsequent T is the same, the T form is _.
Answer: right oblique binary tree, the root node, left oblique binary tree

Guess you like

Origin blog.csdn.net/qq_44256227/article/details/89926019