Wednesday, March 6, 2019

THE QUEUE ADT

A queue is a linear data structure which follows First In First Out (FIFO) principle, in which insertion is performed at rear end deletion is performed at front end. 


                                                           

Types of queue:

  1. Simple queue(Ordinary queue)
  2. Circular queue.
  3. Double ended queue.
  4. Priority queue.

Operations on queue:

 The fundamental operations performed on queue are,
  1. Enqueue
  2. Dequeue
Enqueue: The process of inserting an element in the queue.
Dequeue:  The process of deleting an element from the queue.

Exception conditions:

  1. Overflow: Attempt to insert an element when the queue is full is said to be overflow condition.
  2. Underflow: Attempt to delete an element from the queue when the queue is empty is said to be underflow.  

Applications of queue:

  • When jobs are submitted to a printer they are arranged in order of arrival. thus jobs sent to a line printer are placed on queue.
  • Batch processing in an operating system.
  • Simulation.
  • Mathematics user Queuing theory.
  • To implement priority queue.
  • Time sharing system.
                                           ********   

    



No comments:

Post a Comment