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.
4940Post New Wollega University Interview Questions
How to write media query for mobiles?
What is the difference between android and ios?
What do you know about impediments in scrum? Give some examples of possible impediments.
Why interceptors are used in angular?
What are the different keyboard operations that can be performed in selenium?
What is replace function in excel?
How do you cope without motivation?
What medical aid is NOT allowed to carry with you on air-craft?
What is Tableau knowledge Engine?
Who has access to Campaigns?
What is component in java with example?
What is the difference between a constructor and a destructor?
if i am having a cics,vsam and db2 programs with each functions and i want that each function on screen?
What is the maximum number of swithes that can be connected in series up to down stream point in an LV Distribution system?
What is truncate in mysql?