Data Structures: Write and Test a Java code to implement the priority queue. You may implement the priority queue using ordered arrays or linked lists. What is the time complexity of insert/remove functions in the priority queue?
In the figure below, the priority queue element with the maximum ASCII value will have the highest priority.
CpE 207 Data Structures uoperado argument return value size contents (ordered) insert P a insert P Q insert aE 12323 E P - remove max Q E P insert x E X insert 4 A E P X insert A M remove max x 4 A E insert P A insert E 5676 A insert A remove max P A F - N A sequence of operations on a priority queue
Spring 2020
Write and Test a Java code to implement the priority queue. You may implement the priority queue using ordered arrays or linked lists.
What is the time complexity of insert/remove functions in the priority queue?
Important Note:
Test all functions/show output.
Your program should be well-structured and well-documented.
Indicate the expected time complexity of each function.
You should submit your own code, i.e. you are not allowed to copy from the internet, any other person, or references.