DSproject
DSproject
Abstract
In this project you will implement a priority queue data structure.
Team
You will work in groups of 4 people. Each of the teammates must contribute equally to all
aspects of the projects.
Desciription
A priority queue is a collection of several queues, each one corresponding to pririty level.
Priority levels are indicated by integers. Queue 0 has the highest priority. Queue 1 has the next
highest and so on.
The data item in a node in queue is an integer representing its ID. Items are inserted into the
prirority queue, moved between different priority levels and removed from the priority queue.
Q0: 7, 9, 3, 24
Q1: 8, 1, 2
Q2: 17, 21, 4, 5, 34
Task
You will implement the priority queue as a class. It will have a constructor with a parameter
specifying the number of levels. You will also provide a default constructor with only 2 priority
levels.
The priority queue will support the following operations with obvious meanings:
insert(id, level)
moveUp(id)
moveDown(id)
remove(id)
Submissions:
First submission
Submit only the class with its constructors and a main file demonstrating its use.
If you submit anything more, you will get only 50% of the points maximum.
Final submission will be the complete code together with the implementations of the
operations. Clearly demonstrate their uses in the main.