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

PROGRAMMING:Traversal of trees

Luz5年前 (2021-05-10)题库628
Given a binary tree after order traversal and in order traversal, please output its sequence traversal. Here we assume that the key values are all positive integers that are not equal to each other.
###Input format:
The first line of input gives a positive integer, $$n $$($$Le 30 $$), which is the number of nodes in the binary tree. The second line gives the sequential traversal sequence. The third line gives the middle order traversal sequence. Numbers are separated by spaces.
###Output format:
Output the tree's sequence traversal sequence in one row. The numbers should be separated by one space, and there should be no extra space at the beginning and end of the line.
###Input example:
```in
seven
2 3 1 5 7 6 4
1 2 3 4 5 6 7
```
###Output example:
```out
4 1 6 3 5 7 2
```






answer:If there is no answer, please comment