Addition operation of Queue

0
37
Addition operation of Queue

Before addiotion  opration we must check for fullness of the queue,the maximum valid value of rear pointer is max-1 if rear get this value the queue is full .it is also called queue overflow condition .

 

Void Add (queue*qp,int x)

{

If  (qp-rear==max-1)

Printf(“queue overflow”);

Else

Qp-else(++qp-rear)=x;

}

LEAVE A REPLY

Please enter your comment!
Please enter your name here