-
Notifications
You must be signed in to change notification settings - Fork 95
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
[PriorityQueue] Custom comparator for priorities #121
Comments
Could you use |
Negative timestamp huh? Yeah, I guess that could work. It feels like a dirty workaround rather than proper solution though. |
I agree. 2.0 will have a Heap with an optional comparator that would work here. |
Would it be possible to have another similar internally-ordered structure with custom comparator and non-destructive iteration? |
Like a binary search tree? There is one on the way. 👍 |
I'd like to use the PriorityQueue but in my case the values I need to use for ordering are dates and I need the oldest one first. This means I can't use PriorityQueue because the order would be reversed.
In my opinion PriorityQueue should accept an optional comparator callback to decide the order.
The text was updated successfully, but these errors were encountered: