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.
4972Post New Wollega University Interview Questions
what is mean by tax holiday?
What is the use of progress Bar Control?
How does the rule chaining concept works in uml?
Why can't I see the tabs on my excel spreadsheet?
Name the frameworks that are used in software automation testing?
What is the formula of the net primary production (NPP)? How does NPP relate to the energy pyramids?
What are the benefits of Struts framework?
What is the use of static keyword in swift?
Explain why waste is considered one of the major environmental issues?
From what on-site components does the HT panel monitoring the bus-bars in a 11kV system take inputs?
What do you know about the python enumerate?
How much the minimum recovery should be in swab sampling?
What is cloud computing security?
What is object in c++ example?
What is call back method?