h Home

Data structures:


Queues:

A Queue is an ordered collection of items from which items may be deleted at one end (called the front of the queue) and into which items may be inserted at the other end (the rear of the queue).Queues are first in first out (FIFO) data structures. 
Queues are used where the elements are processed in the order in which they arrive-for example the process queue, the print queue.

Operations on a queue:

InitQueue(Queue):  
        creates an empty queue
Join (Item):          
        inserts an item to the rear of the queue
Leave(Queue) :       
        removes an item from the front of the queue
isEmpty(Queue) :       
        returns true is the queue is empty

Queue overflow:

The condition resulting from trying to add an element onto a full queue.
if(!q.IsFull())
q.Join(item);

Queue underflow:

The condition resulting from trying to remove an element from an empty queue.
if(!q.IsEmpty())
q.Leave(item);

Implementation of stacks:

s


      We provide Queues in c for the educational purposes only. We do not responsiable for the correctness of its contents. the risk of using it lies entirelywith the user.