Current location - Trademark Inquiry Complete Network - Futures platform - CBDE futures market
CBDE futures market
Look at the preface first, the first one is the root, the first one is the root, then the left subtree and finally the right subtree, and the first one must be the root. Draw a first, and then traverse left and right in the middle, which means that A has left subtrees and right subtrees.

A

/ \

Then, the first value in the sequence is B, which is before A in the middle sequence, so B is the left subtree of A..

A

/ \

B

Continue to look at the preface, followed by C and D. In the middle sequence, C is before B, so C is the left subtree of B, D is after B, and D is the right subtree of B.

A

/ \

B

/ \

C D

Next is e, which is in the middle order after d and before a, so e is the right subtree of d.

A

/ \

B

/ \

C D

\

E

Then, F is in the order, and F is the right subtree of A after the middle order.

A

/ \

B F

/ \

C D

\

E

There is no intermediate sequence between A and F, that is to say, F has no left subtree, only the right subtree. Continue to analyze GHIJ as above, and the final binary tree is as follows:

A

/ \

B F

/ \ \

C D G

\ / \

E H J

\

I