105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal
105. Construct Binary Tree from Preorder and Inorder Traversal
题目地址
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
题目描述
代码
Approach 1: Recursion
inorder数组用来获取反向索引
preorder数组用来递归
Time complexity : O(N) & Space complexity : O(N), since we store the entire tree.
Previous1038.Binary-Search-Tree-to-Greater-Sum-TreeNext106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal
Last updated