Closed mat-pielat closed 7 years ago
I tested this before and it resulted in performance degradation (yes, I expected the JIT to optimize it away also, but apparently it does not do so completely).
There'd be no way to do this in only SimplePriorityQueue
without rewriting a large portion of it (since it relies on FastPriorityQueue
), so I have to deny this request, sorry.
Ah, sorry I was misremembering! I do use IComparer
for SimplePriorityQueue
, so this would be possible. Hmm.
Completed in v4.1.1
SimplePriorityQueue
can now take a IComparer<TPriority>
or Comparison<TPriority>
in its constructor.
A simple addition which lets people prioritize maximum elements over minimum ones. It also nicely decouples the default comparer of the priority class from the one used in the queue.