Question: Design a C++ class for PriorityQueue to implement a priority queue with the following methods. Your code should include, in addition to the implementation
Design a C++ class for PriorityQueue to implement a priority queue with the following methods. Your code should include, in addition to the implementation of the class, a main () function that creates an object of the class and invokes the methods implemented. a. PriorityQueue:: PriorityQueue () which constructs an empty priority queue b. PriorityQueue::insert (int e) inserts a new element into a priority queue. PriorityQueue::deletemax () that removes the maximum element in the c. d. priority queue. PriorityQueue: :print () that prints the elements of the priority queue in priority order. What are the time complexities of these methods?
Step by Step Solution
There are 3 Steps involved in it
Here is a C class for implementing a priority queue with the methods you described cpp include inclu... View full answer
Get step-by-step solutions from verified subject matter experts
