Priority Queues with C#: Listing 1.
The priority queue demo program structure.
using System;
using System.Collections.Generic;
namespace PriorityQueues
{
class PriorityQueuesProgram
{
static void Main(string[] args)
{
Console.WriteLine("Begin Priority Queue demo");
Console.WriteLine("Creating priority queue of Employee items");
PriorityQueue <Employee > pq = new PriorityQueue <Employee >();
// Demo code here
Console.WriteLine("End Priority Queue demo");
Console.ReadLine();
}
static void TestPriorityQueue(int numOperations)
{
// Implementation code here
}
}
public class Employee : IComparable <Employee >
{
// Implementation code here
}
public class PriorityQueue <T > where T : IComparable <T >
{
// Implementation code here
}
}
About the Author
Dr. James McCaffrey directs the data science and research efforts at Quaetrix, a data analytics company located near Redmond, Washington. Before joining Quaetrix, James was a senior research engineer at Microsoft. James can be reached at [email protected].