Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2aded16

Browse files
authored
Merge pull request mgechev#136 from BorislavBorisov22/master
Fixed _existsInSubtree comparison of nodes' values bug.
2 parents d07bbc7 + 7393fd2 commit 2aded16

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)