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

Backward iteration for M-BPTREE #126

Open
BrianSipos opened this issue Jul 24, 2024 · 2 comments
Open

Backward iteration for M-BPTREE #126

BrianSipos opened this issue Jul 24, 2024 · 2 comments

Comments

@BrianSipos
Copy link

I have an ordered set of numeric intervals defined using BPTREE_DEF() and I would like to be able to search for a value in the set and then iterate to its predecessor (the previous value by order). But it appears that the BPTREE only allows forward iteration using name_next() function.

Is it possible to provide a name_prev() function to iterate toward the front of the set? Or does the internal structure not allow that currently?

Note that my request is for a backward traversal from an forward iterator, not a reverse iterator. Thanks!

@P-p-H-d
Copy link
Owner

P-p-H-d commented Jul 24, 2024

The internal structure does not allow that currently.
If it is really needed now you can use instead RBTREE which supports the PREVIOUS operator.

@BrianSipos
Copy link
Author

Okay thank you. The RBTREE will work in my case.

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

No branches or pull requests

2 participants