-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add map/set final() method? #132
Comments
I think its possible to implement btree/etc search now. Btw I think its also fix problem with small maps |
It's possible to do btree. But that would also change iteration order. So would probably need a new name than |
It depends on implementation, but by default no, because it sorted order of iteration, it could change iteration speed compared to just sorted array |
Right. I was just misled by looking at my own multiplicative B-tree implementation which has a descending link computation function but lacks the inverse. So just spent some time creating the inverse and proving it. (Both are O(1) if you assume integer mul & div to be constant time). So retaining sorted iteration order is doable. Though it would, as you mentioned, affect speed (by having reduced memory locality for that scenario). Though that's at least predictable, so could be ameliorated by prefetching the successor block in the dereferencing operator. I'm not sure about the iterator category though. I.e. random access iterators are required to have So: is it worth counting the arithmetic to determine iterator category? I'm inclined to say yes, which would effectively downgrade iterator category to bidirectional. |
Maybe you're right and having separate class is better alternative.
It's possible to make b tree for simple types like sorted array + index part.
|
final method should return some map type without insert and other non const methods.
In that case you can use eytzinger/btree/vEB (add user ability to choose) for more efficient search.
What do you think?
The text was updated successfully, but these errors were encountered: