Lab Journal - 04 14032024 020223pm
Lab Journal - 04 14032024 020223pm
Objective(s):
Upon completion of this lab session, learners will be able to:
• Implement queue data structure (enqueue, dequeue, and display)
• Implement Circular queue.
• Use an appropriate data structure to implement the given scenario based problem.
Lab Tasks:
Task 1
Implement queue data structure using arrays and perform following operations.
enqueue ()
dequeue ()
Display ()
Note: size of the array should be fixed. Don’t use dynamic array.
Task 2
Re-do Task 1, and implement circular queue using arrays. Write down the difference between
normal queue and circular queue. Apply all the checks in enqueue(), dequeue(), and display()
function to successfully implement rules of circular queue.
Task 3
Suppose you are working in a hospital as a nurse and you are responsible for managing a
queue of patients waiting at the reception area to see a doctor. Consider the following
scenario;
At the start of your shift there are 6 patients waiting to see a doctor. The first patient in the
queue has minor injury and can wait for up to 30 minutes to see the doctor. The second
patient has severe illness and need to be seen by the doctor immediately. The remaining four
patient have moderate injuries and can wait up to 15 minutes.
Identify the type of data structure that will be most appropriate to implement the above
scenario. Implement the scenario with a choice of your data structure. What is the order in
which a patient will be seen by the doctor? Also, print the order in which the doctor will first
see a patient along with their illness.
%
Enrollment Number: ____________________________
Note : Attempt all tasks and get them checked by your Lab Instructor.
Page 2 of 2