Skip to content

Commit 8caf3a2

Browse files
committed
Add binary search tree.
1 parent fbfdce0 commit 8caf3a2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export default class BinarySearchTreeNode extends BinaryTreeNode {
2828
}
2929

3030
if (value < this.value && this.left) {
31+
// Check left nodes.
3132
return this.left.contains(value);
3233
} else if (this.right) {
34+
// Check right nodes.
3335
return this.right.contains(value);
3436
}
3537

0 commit comments

Comments
 (0)