Algorithm Problem 006: Construct Binary Tree from Preorder and Postorder Traversal
Problem
Problem Source:889. Construct Binary Tree from Preorder and Postorder Traversal(Daily Challenge)
Problem Description:
Given two integer arrays,
preorder
andpostorder
wherepreorder
is the preorder traversal of a binary tree of distinct values andpostorder
is the postorder traversal of the same tree, reconstruct and return the binary tree.If there exist multiple answers, you can return any of them.