Queue (data Structure) Article Index for
Queue
 

Information About

Queue (data Structure)




A queue (pronounced /kuː/) is a particular kind of Collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position. Queues provide services in Computer Science , Transport and Operations Research where various entities such as data, objects, persons, or events are stored and held to be processed later. In these contexts, the queue performs the function of a Buffer .

Queues are common in computer programs, where they are implemented as data structures coupled with access routines, as an Abstract Data Structure or in object-oriented languages as classes.

The most well known operation of the queue is the First-In-First-Out ( FIFO ) queue process. In a FIFO queue, the first element added to in the queue will be the first one out. This is equivalent to the requirement that whenever an element is added, all elements that were added before have to be removed before the new element can be invoked. Unless otherwise specified, the remainder of the article will refer to FIFO queues. There are also non-FIFO queue data structures, like Priority Queue s.

There are two basic operations associated with a queue: enqueue and dequeue. Enqueue means adding a new item to the rear of the queue while '''dequeue''' refers to removing the front item from the queue and returning it to the calling entity.

Theoretically, one characteristic of a queue is that it does not have a specific Capacity . Regardless of how many elements are already contained, a new element can always be added. It can also be empty, at which point removing an element will be impossible until a new element has been added again.

A practical Implementation of a queue e.g. with Pointer s of course does have some capacity limit, that depends on the concrete situation it is used in. For a Data Structure the executing computer will eventually run out of memory, thus limiting the queue size. Queue overflow results from trying to add an element onto a full queue and queue '''underflow''' happens when trying to remove an element from an empty queue.

A bounded queue is a queue limited to a fixed number of items.


SEE ALSO



REFERENCES



EXTERNAL LINKS