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