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

PROGRAMMING:Reconstruction of binary tree

Luz5年前 (2021-05-10)题库399
Given the results of preorder traversal and middle order traversal of a binary tree, the postorder traversal is obtained.
###Input format:
The input may have multiple groups, ending with EOF.
Each group of input contains two strings, which are preorder traversal and meso traversal of the tree. Each string contains only letters and numbers and does not repeat each other.
###Output format:
For each group of input, use one line to output the result of its subsequent traversal.
###Input example:
```in
ABDC BDAC
ABCD BADC
```
###Output example:
```out
DBCA
BDCA
```







answer:If there is no answer, please comment