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.
4970Post New Wollega University C++ Code Interview Questions
How do you find missing values in python?
What is actioninvocation?
Why do we use interface in php?
Introduce yourself in 5 lines.
What happens to detail record when a master record is deleted? What happens to child record when a parent record is deleted? : salesforce crm
Is UML restrictive to system development?
How do rheumatologists collaborate with other medical specialists to provide comprehensive patient care?
Which data structure is used to maintain the file identification?
What is a pure relational orm?
What does break do in loop?
Briefly describe a B+ tree. What is bulk loading in it?
what is dynamodb in aws?
Explain service?
How angular 4 is different from angular 2?
Explain if gateway server is not present cant we do load balancing?