Skip to content
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

lowerBound / upperBound API? #22

Open
nornagon opened this issue May 13, 2021 · 2 comments
Open

lowerBound / upperBound API? #22

nornagon opened this issue May 13, 2021 · 2 comments

Comments

@nornagon
Copy link

Would be great to be able to fetch the largest key smaller than a given search value (and vice-versa)

@w8r
Copy link
Owner

w8r commented May 13, 2021

you can do it with .range(lo, hi, fn) ?

@nornagon
Copy link
Author

ah hm, i think that can only go one direction though? since it starts from lo and goes to hi. if i have a tree sorted in ascending order, there's no way to get the largest key smaller than k in O(log n), right? unless i'm misunderstanding the range functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants