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.
4965Post New Wollega University C++ Code Interview Questions
Can you define data reduction?
What is microsoft powerpoint and its features?
What is the default operating system of raspberry pi, may I use any other operating systems?
Who calls the dealloc strategy? Would we be able to implement dealloc in arc? In the event that indeed, what is the need to do that?
The following is displayed by a print function call?
When we collapse an infocube, is the consolidated data stored in the same infocube or is it stored in the new infocube?
Is Visibroker for C++ 4.5 supported with Delphi 6?
what is the difference between plug-in and workflow with regard to security restrictions?
The system has a program that always includes the word nocomp in its name, how can you determine the number of processes that are using this program?
How can you turn-on and turn-off cas?
Why was the empire state building made of steel?
What are reasons that made Amazon so big?
How will you differentiate between two stroke engine and four stroke engine?
What is the Concept of Encapsulation in OOPS
How can we calculate the efficiency of a Running (On-Load) Motor ? What parameters are required and what is the method ?