Skip to content

Commit 7393fd2

Browse files
Fixed _existsInSubtree comparison of nodes' values bug.
1 parent d07bbc7 commit 7393fd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/data-structures/binary-search-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
if (!root) {
456456
return false;
457457
}
458-
if (node === root.value) {
458+
if (node.value === root.value) {
459459
return true;
460460
}
461461
return this._existsInSubtree(node, root._left) ||

0 commit comments

Comments
 (0)