Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
QUEUE Anoop joseph   Free Powerpoint Templates                               Page 1
Queue• Ordered collection of homogeneous elements• Non-primitive linear data structure.• A new element is added at one end...
Fig: Models of a Queue            Free Powerpoint Templates                                        Page 3
Operations On A Queue1.To insert an element in queue2.Delete an element from queue              Free Powerpoint Templates ...
The Queue OperationPlacing an item in a queue is called“insertion or enqueue”, which is doneat the end of the queue called...
The Queue Operation Removing an item from a queue is called “deletion or dequeue”, which is done at the other end of thequ...
Algorithm QINSERT (ITEM)1.If (rear = maxsize-1 )         print (“queue overflow”) and return2.Else  rear = rear + 1    Que...
Algorithm QDELETE ()1.If (front =rear)     print “queue empty” and return2. Else      Front = front + 1      item = queue ...
Queue Applications Real life examples  Waiting in line  Waiting on hold for tech support Applications related to Compu...
3 states of the queue1.Queue is empty     FRONT=REAR2.Queue is full     REAR=N3.Queue contains element >=1     FRONT<REAR ...
Representation Of       Queues1.Using an array2.Using linked list                 Free Powerpoint Templates               ...
Free Powerpoint Templates                            Page 12
Upcoming SlideShare
Loading in …5
×

Queue data structure

33,875 views

Published on

queue in data structure

Published in: Education, Technology, Business

Queue data structure

  1. 1. QUEUE Anoop joseph Free Powerpoint Templates Page 1
  2. 2. Queue• Ordered collection of homogeneous elements• Non-primitive linear data structure.• A new element is added at one end called rear end and the existing elements are deleted from the other end called front end.• This mechanism is called First-In-First-Out (FIFO).• Total no of elements in queue= rear – front +1 Free Powerpoint Templates Page 2
  3. 3. Fig: Models of a Queue Free Powerpoint Templates Page 3
  4. 4. Operations On A Queue1.To insert an element in queue2.Delete an element from queue Free Powerpoint Templates Page 4
  5. 5. The Queue OperationPlacing an item in a queue is called“insertion or enqueue”, which is doneat the end of the queue called “rear”. Front Rear Free Powerpoint Templates Page 5
  6. 6. The Queue Operation Removing an item from a queue is called “deletion or dequeue”, which is done at the other end of thequeue called “front”. Front Rear Free Powerpoint Templates Page 6
  7. 7. Algorithm QINSERT (ITEM)1.If (rear = maxsize-1 ) print (“queue overflow”) and return2.Else rear = rear + 1 Queue [rear] = item Free Powerpoint Templates Page 7
  8. 8. Algorithm QDELETE ()1.If (front =rear) print “queue empty” and return2. Else Front = front + 1 item = queue [front]; Return item Free Powerpoint Templates Page 8
  9. 9. Queue Applications Real life examples Waiting in line Waiting on hold for tech support Applications related to Computer Science Round robin scheduling Job scheduling (FIFO Scheduling) Key board buffer Free Powerpoint Templates Page 9
  10. 10. 3 states of the queue1.Queue is empty FRONT=REAR2.Queue is full REAR=N3.Queue contains element >=1 FRONT<REAR NO. OF ELEMENT=REAR-FRONT+1 Free Powerpoint Templates Page 10
  11. 11. Representation Of Queues1.Using an array2.Using linked list Free Powerpoint Templates Page 11
  12. 12. Free Powerpoint Templates Page 12

×