Complete the code to create a priority queue of integers.
PriorityQueue<int, int> pq = new PriorityQueue<int, int>(); pq.Enqueue(10, [1]);
The priority value determines the order. Lower priority values come out first. Here, 1 is used as priority.
Complete the code to dequeue the highest priority item from the priority queue.
int highestPriorityItem = pq.[1]();Dequeue() removes and returns the item with the highest priority (lowest priority number).
Fix the error in the code to correctly enqueue an item with priority.
pq.Enqueue([1], 2);
Enqueue expects the item as a string or int. "apple" is a string literal, apple without quotes is undefined.
Fill both blanks to create a priority queue and enqueue an item with priority 3.
var pq = new PriorityQueue<[1], [2]>(); pq.Enqueue("task", 3);
The priority queue stores items of type string and priorities of type int.
Fill all three blanks to dequeue the highest priority item and print it.
var item = pq.[1](); Console.[2](item); // PriorityQueue stores items of type [3]
Dequeue() removes the highest priority item, WriteLine prints it, and the item type is string.
