Comparator

I recently wrote a generic PriorityQueue class which can treat any type of object as the priority (not just integers).  Specifically, the class looked like this:public class PriorityQueue<T, TPriority> { public PriorityQueue() : this(false) { … } public PriorityQueue(bool invert) : this(Comparer<TPriority>.Default) { … } public PriorityQueue(IComparer<TPriority> comparer) { … } public void Enqueue(T item,…

0