Question: using C# Implement the priority queue Enqueue, Dequeue, Peek methods below. This priority queue has the following fields: private List _elements A list that stores
using C#
Implement the priority queue Enqueue, Dequeue, Peek methods below. This priority queue has the following fields:
private List _elements A list that stores the elements in the queue in ascending order.
Peek should throw an invalid operation exception if there are no elements left.
You may not use any other methods other than the ones below and the methods that are apart of the List class.
public int Enqueue() { }
public int Peek() { }
public int Dequeue() { }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
