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 works for Microsoft Research in Redmond, Wash. He has worked on several Microsoft products including Azure and Bing. James can be reached at [email protected].

comments powered by Disqus

Featured

Subscribe on YouTube