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.
4971Post New Wollega University Interview Questions
What's your management style?
Why null value is used in string?
What is internal and external sorting?
How do I send an email from salesforce?
What are some of the other roles that a server running windows server 2008 could fill on the network?
What is the report painter?
List the Basic data types of Kotlin?
Tell us what are internal tables?
What measures do you take to ensure product quality and consistency throughout the manufacturing process?
explain the primary function of domain controllers? : Windows server 2008
What is difference between session_unset and session_destroy?
what are the two methods of modifying sap standard tables? : abap data dictionary
What is the difference between