Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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>();
}
} Advertisements
