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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started