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.
4940Post New Wollega University C++ Code Interview Questions
When do you use merge() and update() in hibernate?
How can you import only a subset of rows from a table?
What is semmni (max-sem-ids in solaris 10+)?
what are the limitations of identity column? : Transact sql
What are the commands in ms word?
What is windows azure and explain its services?
What is the constructor?
What is pl sql commands?
how do you calculate the quantity of steel,cement for plinth beam. (example size 41'*0.58'*1.08')
What is the difference between Classic badi and Kernal badi ?
What are the 4 basic html tags?
What is non linear data structure with example?
on creation of entity how many tables will be created at back end?
List some new features available in jdbc 4.0?
What is enumerator?