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.
5016Post New Wollega University C++ Code Interview Questions
What is your approach to edit a copy?
What does UML stands for?
What are good programming languages for artificial intelligence?
What is laravel policy?
at what pressure ply-wood is obtained by gluing wooden sheets
Why sodium hydroxide used for maintain pH of phosphate buffer
What is drawable/ directory?
Do you need to close br tag?
Is it possible to see information about a process while it is being executed?
What is the toolbox in visual studio?
Where can I get an ansi-compatible lint?
Please brief me about number of pole in alternator.In single phase alternator coils are connected in star or series. How to calculate frequency for the same.
What happens if recursive calls get out of control?
How big is a gigabyte?
Why is java mostly used in embedded systems?