EmbLogic's Blog

Circular Queue Empty and Full condition check algo

1. Create a Queue.
2. In write function
if(rp is less than fp)
{
write;
increment rp;
if(rp==fp)
printf(“queue full”);
}
3.In read function
if(rp is greater than fp)
{
read;
increment fp;
if(rp == fp)
printf(“queue empty”);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>