Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11ef12e

Browse files
committed
update: isEmpty()
1 parent 3475013 commit 11ef12e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/_DataStructures_/Trees/BST/index.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ class BinarySearchTree {
8282
}
8383
return false;
8484
}
85+
86+
isEmpty() {
87+
return this.root === null;
88+
}
8589
}
8690

8791
// const bst = new BinarySearchTree(6);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /