#y1094. 二叉树_后序遍历

二叉树_后序遍历

【题目来源】

https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/

给定两个整数数组 preorder[] 和 inorder[] ,其中 preorder 是二叉树的先序遍历, inorder 是同一棵树的中序遍历,请构造二叉树并输出二叉树的后续遍历 image

数据

输入:

5

3 9 20 15 7

9 3 15 20 7

输出:

9 15 7 20 3