I have a SortedDictionary as defined like this:
SortedDictionary<TPriority, Queue<TValue>> dict;
But I want to maintain the dict in reverse order. I assume I need set the Comparer, but what comparer do I use for a generic TPriority? Note that TPriority implements IComparable.
You can create a reverse comparer quite easily:
Now pass that into the constructor for the dictionary: