Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT. QUEUE ( data structure)

Similar presentations


Presentation on theme: "UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT. QUEUE ( data structure)"— Presentation transcript:

1 UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT

2 QUEUE ( data structure)

3 Queue  It is a linear data structure used to represent a linear list and permits deletion to be performed at one end and of the list and the insertions at the other end.  The information in such a list is processed in the same order as it was received.  i.e-FIRST-COME-FIRST-SERVE basis(FCFS).  Or FIRST IN FIRST OUT(FIFO).

4 Implementation of queue.  Two common ways in which queues may be implemented are as follows:  ARRAYS  POINTERS(one way linear linked list)

5 Different type of queue  Circular queue  Double Ended Queue  Priority queue

6 Operations of queue  Insertion in queue.  Deletion in queue.  List(display) of the queue.

7 Circular queue  Let we have an array named Q, that contains n element in which Q[1] comes after Q[n] in the array.  When this technique is used to construct a queue is called circular queue.  In other word we can say that a queue is called circular when the last room comes just before the first room.

8 Circular queue…. Q[1] Q[2] Q[3]... Q[n-1] Q[n]

9 Queue cont….  In a circular queue when rear=n, if we insert an element then this element is assigned to q[1] instead of increasing rear to n+1.  Suppose queue contains only one element that is front=rear!=0 and suppose that the element is removed then the front and rear pointers are now assigned ‘0’ to indicate that the queue is EMPTY.

10 Priority Queue A Special form of queue from which items are removed according to their designated priority and not the order in which they entered. OR It is a container in which chances or deletion is of the highest priority item according to the same of asssigning priorities to items

11 A Pointer-Based Implementation

12

13

14

15 Differenence between stack n queue  Stacks and queues are very similar  Operations of stacks and queues can be paired off as createStack and createQueue Stack isEmpty and queue isEmpty push and enqueue pop and dequeue Stack getTop and queue getFront

16 Application of queue  An e.g. of queue is time sharing computer system where many users share the system simultaneously.  The procedure, which is used to design such type of system, is Round Robin Technique.  The railway reservation counter is also an example of queue where the people collect their tickets on FIFO or FCFS based.

17 Presented by :  Drashti jadav - 130460116008  Zeel jani - 130460116009  Jay gupta - 130460116010

18 THANK YOU


Download ppt "UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT. QUEUE ( data structure)"

Similar presentations


Ads by Google