Access to elements that have been inserted into the queue


A priority queue is a queue where a numeric priority is associated with each element.

Access to elements that have been inserted into the queue is limited to inspection and removal of the elements with smallest and largest priority only.

A priority queue may have multiple items that are of equal priority.

By "bounded", it is meant that the priority queue has a maximum capacity specified when it is created, and it can never contain more than that number of items. Your specification must specify the following operations:

newPriorityQueue: make a new queue

insert: inserts an element with a certain priority

isEmpty: test if the queue is empty

isFull: test if the queue is full

maxItem: obtain the item in the queue with the highest priority

minItem: obtain the item in the queue with the lowest priority

deleteMax: remove from the queue the item with the highest priority

deleteAllMax: remove from the queue all items that are tied for the highest priority

deleteMin: remove from the queue the item with the lowest priority frequency: obtain the number of times a certain item occurs in the queue (with any priority)

showing it in the form of sets signatures , preconditions and semantics.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Access to elements that have been inserted into the queue
Reference No:- TGS02897327

Expected delivery within 24 Hours