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.
5017Post New Wollega University Interview Questions
What is third party Insurance?
What is the difference between an event and a delegate?
What is the role of persistence layer? : hana modeling
Tell me what is color recipe?
what do you mean by kimball?
By default in vbscript the arguments passed to functions and subroutines are by reference or by value?
there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration
Differentiate between source qualifier and filter transformation?
How do I tell outlook to connect to server?
What Are The Advantages Of Using Pega RPA?
What steps you took to establish rapport with a new staff member?
what is isolation level at dead lock?
Can I use the cloud connector for any protocol?
Can we change the body of the flume event?
What is messaging? How does the runtime handle message passing?