Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.
5016Post New Wollega University Interview Questions
How can I debug my sapscript?
When the bootstrap is inconsistent and how to remedy it?
nwhat are the main Components of servo motor?
How to make a code snippet thread safe?
What is wsimport utility?
what is sales life cycle???
How to convert a list into a set?
why we have to use particular buffer only for dissolution.
Give the balance sheet schedules ,what is differe tax, GIVE THE RATES OF DIFFERED TAX FOR THE YEAR 2008-09
Why and how we use custom pipeline?
How to set layout’s attribute programmatically in android?
What is faster than apache spark?
What are the 3 views and what is the purpose of each view?
wha is Adsorption column chromatography?
How is the front of the queue calculated ?