You are on page 1of 7

LAB # 08:

An Array Implementation of Queue with the


help of Algorithm
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

LAB #08
Lab Task:

01) Write a program as follows for QUEUE

Array based implementation of QUEUE

1. Enqueue an element to queue

2. Dequeue an element from queue

3. Display all

4. Exit

Please Enter Your Choice:

Source Code:

1|Page
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

2|Page
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

Output:

3|Page
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

02) Test the program using the following procedure: QUEUE of size N=6

1. Call EnQueue (5)


2. Call EnQueue (2)
3. Call EnQueue (3)
4. Call DeQueue ()
5. Call DeQueue ()
6. Call EnQueue (6)
7. Call EnQueue (3)
8. Call Display ()

Source Code:

4|Page
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

5|Page
Data Structures and Algorithms (CS-212L) Name: M. Aaman Khan Roll Number: 17

Output:

6|Page

You might also like