DEFINATION:
QUEUE:- is a collection of node. Queue consist of two parts
a) FRONT- items are deleted from the front part of queue.
b) REAR- items are inserted from the rear part of queue.
*Order of insertion is same to that of order of deletion of data items of queue.
*it is based on FIFO( FIRST IN FIRST OUT )
*Eg-suppose we want to add items in queue say a b c d e etc. so order of insertion a b c d e. Order of deletion a b c d e etc.
*queue deals with manipulation and retrival of data items from the internal memory.
*QUEUE is a LINEAR DATA STRUCTURE.
REPRESENTATION OF QUEUE:
2 METHODS
1) ARRAY REPRESENTATION OF QUEUE
2)DYNAMIC IMPLEMENTATION OF QUEUE
HOW TO INSERT AND DELETE IN QUEUE:
=>FOR INSERTION:
REAR=REAR+1
QUEUE[REAR]=ITEM
=>FOR DELETION:
ITEM=QUEUE[FRONT]
FRONT=FRONT+1
TYPES OF QUEUE :
1) LINEAR QUEUE
2) CIRCULAR QUEUE
Kindly Share The Love »»
|
|
Tweet | Save on Delicious |
No comments:
Post a Comment