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.
4925Post New Wollega University Interview Questions
Tell me how to find the custom directory in front end?
How we can maintain session in rest services?
what are enumerations in C
Can u explain me banking domain projects? And in banking domain projects how many dimension tables and how many fact tables and how to load source and targets in mapping level Please explain give me one example
What is composer used for?
What is slice in go?
How would you obtain segment and offset addresses from a far address of a memory location?
What is allowanonymous in mvc?
How to replace a substring in a given string?
Explain the difference between the while and for loop. Provide a .net syntax for both loops?
Explain drupal bootstrap process?
how to set the time in digital timer ?
Could we start a variable with number like $4name?
how to decide for one product require water content or LOD?
Is it possible to have a deadlock involving only one process?