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.
4398Post New Wollega University C++ Code Interview Questions
Explain the meaning of alternate, artificial, compound and natural key?
Define the phenomenon resonance?
How do I make a table even in word?
Can we call stored procedure in view in sql server?
What are the types sibling libraries in wpf?
How do you insert a footnote in word 2016?
Define data services components?
What is precompiler in db2?
How we can scale Reshift database?
what will be d.g. capacity to cater together for 14hp A.C. load & 3kw lighting load
What is the format specifier?
Is there an example how to configure externalfileaccess setting in firebird.conf?
Explain system testing?
Is treeset sorted?
How to insert table in ms word 2007?