Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5c6b4f2

Browse files
committedDec 5, 2018
updata lowest common ancestor.js
1 parent dbee69f commit 5c6b4f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/algorithms/tree/lowest-common-ancestor/lowestCommonAncestor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function lca(rootNode, firstNode, secondNode) {
2828
const firstDepth = calcDepth(firstNode);
2929
const secondDepth = calcDepth(secondNode);
3030

31-
for (int i = 0; i < Math.abs(firstDepth - secondDepth); i++) {
31+
for (let i = 0; i < Math.abs(firstDepth - secondDepth); i++) {
3232
if (firstDepth > secondDepth)
3333
firstNode = firstNode.parent;
3434
else

0 commit comments

Comments
 (0)
Please sign in to comment.