GeekInterview.com
Series: Subject: Topic:
Question: 2 of 17

What is a circular queue? Why is it better than a normal queue? Give some practical Examples of usage of circular queue.

Asked by: Interview Candidate | Asked on: Oct 1st, 2003
Showing Answers 1 - 2 of 2 Answers
payelmisty

Answered On : Apr 11th, 2008

View all answers by payelmisty

Circular queue is a bounded queue which implements arrays.It is beter than a normal queue because in this we can effectively utilise the memory space.If we have a normal queue and have deleted some elements from there then empty space is created there and even if the queue has empty cells then also we cannot insert any new element because the insertion has to be done from one side only(i.e rear or tail) and deletion has to be done from another side(i.e front or head).But in case of circular queue the front and rear are adjacent to each other.

Yes  1 User has rated as useful.
  
Login to rate this answer.
montaipuchu

Answered On : Aug 27th, 2008

View all answers by montaipuchu

In case of a ordinary queue, the insertion take place from the front end and the deletion take place  from the rear end. In the case of deletion from the front end, the datas are deleted but the space of the queue is not utilized for the further storage. So this problem is solved in case of a circular queue. Even if the rear is full but there is space at the front end, then the data can be stored in the front end until the queue overflows.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.