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.
4939Post New Wollega University Interview Questions
What is the difference between chartfield and chart of accounts?
What do you understand by b2b, b2c and b2g? : insurance cold calling
What is the difference in the web.xml and weblogic.xml ?
What is 2nd level cache?
What is makefile in unix?
What is a zed encoder? How does it work?
Can you explain the directory structure for a struts folder in brief ?
Is there any difference between primary key and unique with the not null condition?
from which subjects most of the technical que will b asked for hpcl(electrical).pls help me
Explain the term paired RDD in Apache Spark?
. Using sed and grep, write a command which lists files and directories with following properties: (i) created in 1999 (ii) with user's as owner and group
How do you backup a wordpress site?
What are diffusion models, and how do they differ from GANs?
What kind of application/services uses Redshift database?
Which PHP compatibility is used for Drupal?