-
Notifications
You must be signed in to change notification settings - Fork 655
feat(data-structures/unstable): add BinarySearchTree
methods ceiling
, floor
, higher
, lower
#6544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6544 +/- ##
=======================================
Coverage 94.74% 94.74%
=======================================
Files 583 584 +1
Lines 46478 46560 +82
Branches 6523 6539 +16
=======================================
+ Hits 44036 44114 +78
- Misses 2399 2402 +3
- Partials 43 44 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
It's not possible to reimplement class A {
#private() {
return 'A'
}
foo() {
console.log(this.#private())
}
}
class B extends A {
#private() {
return 'B'
}
bar() {
console.log(this.#private())
}
}
new A().foo() // logs 'A'
new B().foo() // still logs 'A'
new B().bar() // logs 'B' |
Ah, I see where I got confused. There's a change to an export in |
@WWRS Sorry for the delay in review. BinarySearchTree is part of stable API and we prefer to not mix stable features and unstable features. Can you create an unstable version of BinarySearchTree in |
@kt3k Moved to |
BinarySearchTree
methods ceiling
, floor
, higher
, lower
BinarySearchTree
methods ceiling
, floor
, higher
, lower
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating!
LGTM
closes #3069
May break custom binary trees that reimplementAs pointed out, this is not a problem.BinarySearchTree.#findNode()
. I think it's unlikely that anyone is doing that given that#findNode()
should work on all child data structures of binary search trees.The new methods have the same time complexity as
find()
.