Open enumag opened 6 years ago
Could you use -timestamp
for the priority?
Negative timestamp huh? Yeah, I guess that could work. It feels like a dirty workaround rather than proper solution though.
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. :+1:
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.