Unit-6
A Queue is a linear structure which follows a particular order in which the
operations are performed. The order is First In First Out (FIFO).
It has two ends named as front and rear. From the front end one can delete the
elements and from rear end one can insert the element.
Operations:
create()
insert()
delete()
display()
Que[Max] is a finite collection of elements in which insertion of elements is by rear end
and deletion of element is by front end
Precondition:
The front and rear should be within the maximum size MAX.
Before insertion operation, whether the queue is full or not is checked
Before any deletion operation, whether the queue is empty or not is checked.
Various operations on the queue are:
1. Queue overflow.
2. Insertion of the element into queue.
3. Queue Underflow.
4. Deletion of the element from the queue.
5. Display of the queue.
Using stack implement a queue
Insertion of element into the queue:
Unit-6 1
Unit-6
A Queue is a linear structure which follows a particular order in which the
operations are performed. The order is First In First Out (FIFO).
It has two ends named as front and rear. From the front end one can delete the
elements and from rear end one can insert the element.
Operations:
create()
insert()
delete()
display()
Que[Max] is a finite collection of elements in which insertion of elements is by rear end
and deletion of element is by front end
Precondition:
The front and rear should be within the maximum size MAX.
Before insertion operation, whether the queue is full or not is checked
Before any deletion operation, whether the queue is empty or not is checked.
Various operations on the queue are:
1. Queue overflow.
2. Insertion of the element into queue.
3. Queue Underflow.
4. Deletion of the element from the queue.
5. Display of the queue.
Using stack implement a queue
Insertion of element into the queue:
Unit-6 1