PROGRAMMING:Traversing binary tree by hierarchy
Define the precedence sequence of a binary tree in the form of string. If the character is' # ', it means that the binary tree is empty. Otherwise, the character is the data element of the corresponding node. Read in the corresponding sequence, build a binary tree, and then traverse the binary tree hierarchically and output node data.
###Input format:
A pre order sequence in the form of a string (that is, the data type of a node is a single character)
###Output format:
The result of traversing binary tree by hierarchy
###Input example:
Here is a set of inputs. For example:
```in
ABDG##HI####CE#J##F##
```
###Output example:
The corresponding output is given here. For example:
```out
ABCDEFGHJI
```
answer:If there is no answer, please comment
###Input format:
A pre order sequence in the form of a string (that is, the data type of a node is a single character)
###Output format:
The result of traversing binary tree by hierarchy
###Input example:
Here is a set of inputs. For example:
```in
ABDG##HI####CE#J##F##
```
###Output example:
The corresponding output is given here. For example:
```out
ABCDEFGHJI
```
answer:If there is no answer, please comment