Skip to content

Commit e46cb5a

Browse files
committed
Runtime: 121 ms (Top 79.59%) | Memory: 44.5 MB (Top 97.46%)
1 parent 30c830f commit e46cb5a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/algorithms/C/Construct Binary Tree from Preorder and Inorder Traversal/Construct Binary Tree from Preorder and Inorder Traversal.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// Runtime: 121 ms (Top 79.59%) | Memory: 44.5 MB (Top 97.46%)
12
/**
23
* Definition for a binary tree node.
34
* function TreeNode(val, left, right) {
4-
* this.val = (val===undefined ? 0 : val)
5-
* this.left = (left===undefined ? null : left)
6-
* this.right = (right===undefined ? null : right)
5+
* this.val = (val===undefined ? 0 : val)
6+
* this.left = (left===undefined ? null : left)
7+
* this.right = (right===undefined ? null : right)
78
* }
89
*/
910
/**
@@ -24,6 +25,6 @@ var buildTree = function(preorder, inorder) {
2425
root.right = create(mid + 1, inorderEnd);
2526
return root;
2627
}
27-
28-
return create(0, inorder.length -1);
29-
};
28+
29+
return create(0, inorder.length -1);
30+
};

0 commit comments

Comments
 (0)