Question: Implement a priority queue. Your queue needs to support adding new elements, return the element with the highest priority and removing the element with the

Implement a priority queue. Your queue needs to support adding new elements, return the element with the highest priority and removing the element with the highest priority. Adding an element and removing the element with the highest element should be at most O(log(N)) where N is the size of the queue. Your queue also needs to be able to hold Student objects. A student has a name, student id, email address, a GPA and number of units taken. GPAs are between 0.0 and 4.0. Units taken are between 0 and 150. A students priority is determined 70% by the number of units taken and 30% by their GPA . You need to be able to print out the elements in the queue in priority order. Print out the student id and name of the student.

*** Do not use any existing priority queue library.

*** Use Java

Edited: Probably using binary heap ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!