QUEUE - A List of Elements  :
Print this page
 

ALGORITHM FOR ADDITION AND DELETION OF ITEMS IN A QUEUE

note : addition is done only at the rear end of a queue like in a ticket counter line ....
add ( item ,queue , n ,rear) 
{
if (rear==n) 
then print " queue is full "
else
{
rear=rear+1;
queue [rear]=item;
}
}
     
Tabular View of ADD operation
   
Prev