Skip to content

Commit 96a0c39

Browse files
committed
Fixed time complexity for constructBinary
1 parent df9552a commit 96a0c39

File tree

1 file changed

+1
-1
lines changed
  • construct-binary-tree-from-preorder-and-inorder-traversal

1 file changed

+1
-1
lines changed

construct-binary-tree-from-preorder-and-inorder-traversal/nhistory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ var buildTree = function (preorder, inorder) {
1313
return root;
1414
};
1515

16-
// TC: O(n)
16+
// TC: O(n^2)
1717
// SC: O(n)

0 commit comments

Comments
 (0)