-->
当前位置:首页 > 题库

PROGRAMMING:Building and traversing binary tree

Luz5年前 (2021-05-10)题库407
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 of * * binary chain storage structure * *, then traverse the binary tree 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:
Middle order traversal result
###Input example:
Here is a set of inputs. For example:
```in
ABC##DE#G##F###
```
###Output example:
The corresponding output is given here. For example:
```out
CBEGDFA
```







answer:If there is no answer, please comment