Question: Design and implement an index minimum priority queue C++ template class which takes keys of generic type. Name your class IdxMinPQ, and implemented using a

Design and implement an index minimum priority queue C++ template class which takes keys of generic type. Name your class IdxMinPQ, and implemented using a contiguous-array based binary heap.

IndexMinPq(int N)//create indexed priority queuewith indices 0, 1, ..., N 1 void insert(int i, Key key) // associate key with index i void decreaseKey(int i, Key key) //decrease the key associated with index i bool contains(int i) //is i an index on the priority queue? int delMin() //remove a minimal key and return its associated index bool isEmpty() //is the priority queue empty? int size() //number of keys in the priority queue };

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!