⌘BABAKOV.NET Let's code!
100% [dark] [ru]

Ascending and Descending Sorting in PriorityQueue

A simple example of a simple Comparer for sorting

//Descending Sort, Integer
var queue = new PriorityQueue<int, int>(Comparer<int>.Create((x, y) => y - x));

//Ascending Sort, Object
var queue = new PriorityQueue<ObjectA, ObjectB>(Comparer<ObjectB>.Create((x, y) => x.Something.CompareTo(y.Something));

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.