Categorygithub.com/szhou12/leetcode-goleetcode0105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal
package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
105. Construct Binary Tree from Preorder and Inorder Traversal
Solution idea
Recursion
与 106 思路基本上完全一致,唯一的不一样在于 root 在 preorder的头部
Time complexity = $O(n)$