I've an assignment and the requirements are described in the code comment below:
package com.abc.exercise;
/**
* 1) Implement a priority queue class with the interface given below.
* 2) Multiple items with the same priority can be added to the queue
* 3) java.util package should not be used
* 4) You can add your own behaviour as required
*/
public interface PriorityQueue<T> {
// An item with the given priority is added into the queue
public void add(int priority, T value);
//finds the item with the highest priority and removes it from the queue
public T remove();
//finds the item with the highest priority but does not remove it from the queue
public T find();
//Returns the number of items in the queue.
public int qsize();
}
How should I proceed?