Sunday, 18 September 2011

Queue

Queue  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. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once an element is added, all elements that were added before have to be removed before the new element can be invoked. A queue is an example of a linear data structure


Queue are of different types:-


Linear Queue:-In this type of queue elements are in linear way where insertion can be done only from one end called REAR and deletion can be done only from one end called  FRONT.
 Representation Of Linear Queue as an array and linked list :-


Download Link:
http://www.fileserve.com/file/gYKD4BJ/Linear_Queue_as_an_array.txt
http://www.fileserve.com/file/bSFzAx6/Linear_Queue_as_linked_list.txt



Circular Queue:-


Representation Of Circular Queue as an array:-


Download Link:  http://www.fileserve.com/file/th7PZqE/CircularQueue_as_an_array.txt




Priority Queue:-Priority Queue is a collection of elements such that each element has been assigned a priority and such that the order in which the element are deleted and processed from the following rule:

  • An element of higher priority is processed before any other element of lower priority.
  • Two elements with the same priority are processed according to order in which they are added to the queue. 

Representation Of Priority Queue as a linked list :-


Download Link:  http://www.fileserve.com/file/97zVuRT/PriorityQueue_as_a_linked_list.txt




DE-Queue:-DEQueue is a linear list in which element can be added or removed at either end but not in middle .The term DEQueue is contraction of name Double Ended Queue









No comments:

Post a Comment