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 .range_index() for RedBlackTreeMap/RedBlackTreeSet #56

Open
liangyongrui opened this issue Jun 30, 2021 · 1 comment
Open

Comments

@liangyongrui
Copy link

Is it possible to search RedBlackTreeMap by index?

like this

@orium
Copy link
Owner

orium commented Jun 30, 2021

Currently it's not possible. To have that with O(lg(n)) we would need to add some extra information to each node (the number of elements to the left).

I'm not sure if there is enough demand for this to spend and extra usize per node.

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