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.
5014Post New Wollega University C++ Code Interview Questions
Why do make the subnets?
Why is ubuntu considered as safe?
What does law of mass action states?
What is xl file?
What is thread safe in c#?
why it is difficult to make heavy cuts if a form turning tool is complex in shape?
can anyone guide me how to get any of the previous year GAIL question papers? are they available? 0n 2nd august i have to take the written test.
Mention how hadoop is different from other data processing tools?
Why do we need properties in c#?
How silverlight 4 is different from silverlight 3?
hai sir pls send me Appsc Assistant Statistical Officer(ASO) previous papers. And Apsrtc MST previous papers. Thanks you sir.
in material sub stution when we sell the sub stute material with main item price it will display the list of materials with main price or only one substute material is substuted automatically in first senario i practed it will display the list of materials but price taking it's oown price.in 2 case substute item is picking main item price but it is possible for only one substute item only.may question is it possible to display list of material case 2?thanking you in advance
I want to collect email addresses of all registered users. Which table should I refer?
which type inter lock use in petrochemical refinery,and oil & gas?
Why we use dbms for projects? Why don’t we save any application data in separate files instead of dbms?