Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree
Fantastic news! We've Found the answer you've been seeking!
Question:
Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.
Example 1:
Input: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3]Output: [3,9,20,null,null,15,7]Example 2:
Input: inorder = [-1], postorder = [-1]Output: [-1]
Constraints:
- 1
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: