- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Priority Queues with C#
A priority queue is held information with a priority value. It is an extension of queue.
The item with the highest property is removed first when you try to eliminate an item from a priority queue.
Let us see how to set priority queue −
public class MyPriorityQueue <T> where T : IComparable <T> { }
Now let us add an item. In the below example the items get stored in info, which is a generic list.
Example
public class MyPriorityQueue <T> where T : IComparable <T> { private List <T> info; public MyPriorityQueue() { this.info = new List <T>(); } }
- Related Articles
- Priority Queues in C++
- Dual Priority Queues
- Meldable Priority Queues and Skew Heaps
- Implement Stack using Queues in C++
- Priority Queue Introduction in C/C++
- C++ Program for Priority Scheduling
- C++ Program to Implement Stack Using Two Queues
- Circular queues-Insertion and deletion operations in C++
- C++ Program to Implement Priority Queue
- Dequeue and Priority Queue in C++
- IPC using Message Queues
- What are Scheduling Queues?
- C# Program to display priority of Thread
- Priority Queue using Linked List in C
- Double ended priority queue in C++ Program

Advertisements