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

Implement Cursor API for BTreeMap #26

Open
declanvk opened this issue Feb 14, 2023 · 0 comments
Open

Implement Cursor API for BTreeMap #26

declanvk opened this issue Feb 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@declanvk
Copy link
Owner

See rust-lang/libs-team#141 for design of API and links to implementing CR


This feature may be a bit difficult because I believe that the BTreeMap implementation maintains a linked-list among leaf nodes so that traversing among those nodes is easy.

Options:

  1. We also start maintaining a leaf node linked list, this would likely speed up and simplify iterators, but at the cost of increased memory usage in the tree. Currently our iterators maintain a stack of previous nodes, we could save some memory usage here
  2. We could implement the cursor API using the stack based traversal method, but moving to the next node would be slightly slower.e
@declanvk declanvk added the enhancement New feature or request label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant