We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a04c0c2 commit 0375a95Copy full SHA for 0375a95
Tree/ConstructBinaryTreePreorderInorder.swift
@@ -2,7 +2,7 @@
2
* Question Link: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
3
* Primary idea: Always use the first element in preorder as root,
4
* then find that one in inorder to get left and right subtrees
5
- * Time Complexity: O(n), Space Complexity: O(n)
+ * Time Complexity: O(nlogn), Space Complexity: O(1)
6
*
7
* Definition for a binary tree node.
8
* public class TreeNode {
0 commit comments