CS 1312 Exercise 6: Application of queue solution


Original Work ?


5/5 - (2 votes)

• Create queue ADT as a header file “queue.h”.

• Create node with two fields namely job number and burst time (jno, bt).

• Assume there are two queues Q1 and Q2.

• Insert the data given below in Q1 and Q2 based on minimum waiting time.
(J1, 6), (J2, 5), (J3, 2), (J4, 3), (J5, 7), (J6, 3), (J7, 7), (J8, 2), (J9, 3) and (J10, 7).

• Compute the average waiting time of Q1 and Q2

• Display both the queues with average waiting time.

1. Assume jobs arrive at same time.
2. The first two jobs will be entered into Q1 and Q2 respectively.
3. If minimum waiting times of both the queues are same, then insert into Q1.