Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Sunday, 7 December 2014

Generic Priority Queue Using Sorted Dictionary in C#

A priority queue is a queue in which items are sorted according to priority. An item with highest priority will come out of it first.

Here, we will see a generic priority queue implemented using Sorted Dictionary. By generic, it means we can make a priority queue of any type of objects, but the object should contain some priority property. In short, the generic object should be a derived class of the PriorityNode.