Dsa-Lab 08 (Queue)
Dsa-Lab 08 (Queue)
Objective:
Demonstrate Queue and discuss all the operations performed on Queue.
Theory:
In this Lab, we discuss the Queue data type. Queue is a linear data structure in which the
insertion and deletion operations are performed at two different ends. In a queue data
structure, adding and removing elements are performed at two different positions. The
insertion is performed at one end and deletion is performed at another end. In a queue data
structure, the insertion operation is performed at a position which is known as 'rear' and
the deletion operation is performed at a position which is known as 'front'. In queue data
structure, the insertion and deletion operations are performed based on FIFO (First In
First Out) principle.
Basic Operations
The following operations are performed on a queue data structure:
1. enQueue(value) - (To insert an element into the queue)
2. deQueue() - (To delete an element from the queue)
3. display() - (To display the elements of the queue)
Queue data structure can be implemented in two ways. They are as follows
1. Using Array
2. Using Linked List
When a queue is implemented using an array, that queue can organize an only limited
number of elements. When a queue is implemented using a linked list, that queue can
organize an unlimited number of elements.
Lab Objectives:
Practical # 08 Page 2 of 4
C++ program: Write C++ program to implement QUEUE using Array.
OUTPUT
Practical # 08 Page 3 of 4
Review Questions/ Exercise:
____________________________________________________________ _________________________________________________
Name: _____
Roll #: _____
Date: _____
Subject Teacher
Remarks:
Practical # Page 4 of 4
08