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

Reverse Iteration #3

Open
VJalili opened this issue Oct 8, 2014 · 1 comment
Open

Reverse Iteration #3

VJalili opened this issue Oct 8, 2014 · 1 comment

Comments

@VJalili
Copy link

VJalili commented Oct 8, 2014

Hi, I should say: BPlusTree has lots of quite utile features specially for iterations.
Features such as: tree.EnumerateFrom, tree.EnumerateRange, or tree.GetEnumerator().
Leveraging on these functions most of common operations are supported out-of-box, however I was wondering if there is any possibility to do reverse iteration. For example a variation of tree.EnumerateFrom which starts iterating from given key toward BEGINNING of tree rather END. Maybe this aspect is covered, in that case I would appreciate if you could explain it. Otherwise, would you mind please guide me through ?

Reverse iteration is indeed useful when trying to perform some operations on key's surrounding the given key.

@csharptest
Copy link
Owner

Correct, reverse iteration is currently not supported. It would be possible to implement a copy of BPlusTree.Enumerator that would iterate the nodes in reverse. As of yet, I have not implemented this. I'll leave this open as an enhancement request.

Feel free to implement this, and all the required unit tests, and send a push request.

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