0% found this document useful (0 votes)
18 views2 pages

Lab Journal - 04 14032024 020223pm

This document outlines a lab assignment for a Data Structures and Algorithms course. The objective is for students to implement queue data structures and use them to solve problems. There are three tasks: 1) Implement a normal queue using arrays, 2) Implement a circular queue using arrays, noting the differences between normal and circular queues, and 3) Model a hospital patient queue scenario using an appropriate data structure, noting the order patients would be seen. Students are graded out of 10 total marks for completing the tasks.

Uploaded by

rakiro4819
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Lab Journal - 04 14032024 020223pm

This document outlines a lab assignment for a Data Structures and Algorithms course. The objective is for students to implement queue data structures and use them to solve problems. There are three tasks: 1) Implement a normal queue using arrays, 2) Implement a circular queue using arrays, noting the differences between normal and circular queues, and 3) Model a hospital patient queue scenario using an appropriate data structure, noting the order patients would be seen. Students are graded out of 10 total marks for completing the tasks.

Uploaded by

rakiro4819
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Bahria University, Lahore Campus

Department of Computer Science


Lab Journal 04
(Spring 2024)

Course: Data Structures and Algorithm - Lab Date: _______________


Course Code: CSL-221 Max Marks: 10
Faculty’s Name:

Name: _____________________ Enroll No: ___________________ Class:


______________

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: ____________________________

Lab Grading Sheet :


Max
Obtained
Task Mark Comments(if any)
Marks
s
1. 02
2. 03
3. 05
Total 10 Signature

Note : Attempt all tasks and get them checked by your Lab Instructor.

Page 2 of 2

You might also like