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.
4486Post New Wollega University C++ Code Interview Questions
What is asthenosphere?
at what base you will tell the direction of rotation of dc motors and generators?
What Are Various Investments Under Section 80(c) Of Income Tax Act?
What is Ambari shell?
What is quality management system?
what is the use of delivery and billing documents header and item
Explain acid rule of thumb for transactions in c#.
Explain temporal data types in oracle
How to install laravel?
What is producser for Anti collosion protection for DUMER 220Ton in Minse
Explain the difference between debug.write and trace.write? When should each be used?
Why π-filters are not suitable for varying loads?
What do you mean by chromounits in java8?
Write down ten test cases for below scenario: Increase the day by 1 and date format should be mm/dd/yyyy Conditions are : date should not be greater then 31 and date<1 month should not be greater then 12 and month<1 year should not be greater then 10000 and year<1 Thanks in advance
What is the meaning of typedef struct in c?