May 2021 1 108 Report
Delete A Circular Queue ?

here's the code I'm not getting :

void queueins(struct queue *q,int x)

{

if (((q->front ==0) &&(q->rear==MAXSIZE -1))||(q->front ==q-

>rear+1))

{

printf("Queue full\n");

display(q);

return;

}

else

{

if (q->front == -1)

{ q->front =0; q->rear = 0;}

else

q->rear = (q->rear+1) % MAXSIZE;

q->items[q->rear] = x;

}

}

pls explain.. I find this very boring !

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.