Introduction - If you have any usage issues, please Google them yourself
First understand the concept:
Preorder traversal: the operation to access the root node occurs before the left and right subtrees are traversed.
Middle order traversal: the operation to access the root node occurs in the left and right subtrees.
Sequential traversal: the operation to access the root node occurs after traversing the left and right subtrees.
Eg: the following sequence traverses to DBCEFGHA, and the sequence traversal is EDCBAHFG, and the preorder traversal (online example)
Solution: first, see the back order traversal DBCEFGHA, A is the total root node.
Then find the middle order traversing the position of A in EDCBAHFG, then EDCB in the left branch of A, and HFG in the right branch of A;
Repeat the first two steps, the last one from the back order traversal, searching the corresponding points in the middle order traversal, and the left and right branches...
Finally, AECDBHGF can be verified by itself.