CEG's Linux User Group

  • Increase font size
  • Default font size
  • Decrease font size
Home Labs CIRCULAR QUEUE IMPLEMENTATION USING ADT

CIRCULAR QUEUE IMPLEMENTATION USING ADT

E-mail Print
User Rating: / 2
PoorBest 
Article Index
CIRCULAR QUEUE IMPLEMENTATION USING ADT
SOURCE CODE
DOCUMENTATION
TEST CASES AND COMPATIBILITY
All Pages

 

IMPLEMENTATION OF A CIRCULAR QUEUE USING ADT

 

The aim of this article is to implement a circular queue using abstract data type.

INTRODUCTION:

We know that a linear queue is a “first in first out “ data structure,i.e., insertion can be made only at the end and deletion can be made only at the front. In a linear queue, the traversal through the queue is possible only once,i.e.,once an element is deleted,we cannot insert another element in its position. This disadvantage of a linear queue is overcome by a circular queue, thus saving memory.

 

 

Linear queue:

img1

No more elements can be inserted in a linear queue now.

 

Circular queue:

img2

 

In a circular queue, after rear reaches the end of the queue, it can be reset to zero. This helps in refilling the empty spaces in between.

This article contains the code for implementing a circular queue using ADT. Here, we demonstrate all the functions that can be performed in a circular queue.



Last Updated on Saturday, 13 June 2009 08:25  
Please register or login to add your comments to this article.