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

  • Steve Sanderson Wows Web-Devs with Peek at 'Blazor United' for .NET 8

    "We've started some experiments to combine the advantages of Razor Pages, Blazor Server and Blazor WebAssembly all into one thing."

  • Spring Cloud Azure 5.0 Ships with Updated, Redesigned Documentation

    "We've created a new online resource, Azure for Spring developers, to help Spring developers code, deploy and scale their Spring applications on Azure.

  • What's New in Progress Telerik UI for Blazor, .NET MAUI and WinForms

    The company said its new Progress Developer Tools R1 2023 release includes design and accessibility upgrades, deeper customizations and support for the latest frameworks.

  • Take ChatGPT for a Spin with VS Code Tools

    With ChatGPT being the first "It" tech in the cutting-edge AI space that regular people can play around with, it's no wonder that tools to use it are exploding in the Visual Studio Code Marketplace.