C functions precise to verify emptiness of Queue - Data Structure
Q. Which of the following ' C ' functions is precise to verify the emptiness of a Queue?- Published on 19 Oct 15a.
int empty(Q*P)
{
if (P->R==-1)
return (1);
return(0);
}
b.
int full (Q*P)
{
if(P->R==MAX-1)
return(1);
return(0);
}
c.
int empty (Q*P)
{
if (P<-R==-1)
return(0);
return(1);
}
d.
int full (Q*P)
{
if(P<-R==MAX-1)
return(0);
return(1);
}
ANSWER:
int empty(Q*P)
{
if (P->R==-1)
return (1);
return(0);
}