Desktop applications development

 

 

implement a Priority Queue from a Heap. You will then implement a class Student and use your Priority Queue to output the students two different ways.

You are provided with 8 files:

PriorityQueueDriver.java
IKey.java
Heap.java
IPriority.java
IPriorityQueue.java
PriorityQueue.java
Student.java
students.txt
You will need to implement the following: an interface for priority methods in IPriority, a priority queue in PriorityQueue.java, and the main program in PrioirtyQueueDriver.java. The files IKey.java, Heap.java, IPriorityQueue.java, and Student.java are read only. You do not need to make an implementation changes to these files.

Part 1: Implement IPriority
In the file IPriority.java, you should implement an interface that will need to be used by any data type that contained by the priority queue. Make sure you do each of the following.
1 Write a method declaration for the getter. Use the signature Integer getPriority();
2 Write a method declaration for the setter. Use the signature void setPriority(Integer priority);
Note: This interface will only have two methods.

Part 2: Implement a PriorityQueue
In the file PriorityQueue.java, you should implement a generic priority queue. Make sure you do each of the following.
1 Declare one instance variable of type Heap to store your data
2 Code a one parameter constructor that takes a boolean that indicates whether a lower number should have a higher priority. If the parameter is true, then the constructor should instantiate the Heap as a min heap. If the parameter is false then the constructor should instantiate the heap as a max heap.
3 Code a default constructor. This constructor can simply call the one parameter constructor passing it true or you can have the constructor instantiate the Heap as a min heap since that is the default behavior for a priority queue.
4 Implement the methods in IPriorityQueue. IPriorityQueue has five methods you should implement each one.

 

The post Desktop applications development first appeared on COMPLIANT PAPERS.

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top