Thursday, December 6, 2007

Circular Queue Data Structure



In a standard queue data structure re-buffering problem occurs for each dequeue operation. To solve this problem by joining the front and rear ends of a queue to make the queue as a circular queue
Circular queue is a linear data structure. It follows FIFO principle.
  • In circular queue the last node is connected back to the first node to make a circle.
  • Circular linked list fallow the First In First Out principle
  • Elements are added at the rear end and the elements are deleted at front end of the queue
  • Both the front and the rear pointers points to the beginning of the array.
  • It is also called as “Ring buffer”.
  • Items can inserted and deleted from a queue in O(1) time.

DeQueue Data Structure

DeQueue (or) Deque (Double ended Queue) :-
DeQueue is a data structure in which elements may be added to or deleted from the front or the rear.
Like an ordinary queue, a double-ended queue is a data structure it supports the following operations: enq_front, enq_back, deq_front, deq_back, and empty. Dequeue can be behave like a queue by using only enq_front and deq_front , and behaves like a stack by using only enq_front and deq_rear. .
The DeQueue is represented as follows.


Priority Queue

Priority queue is a linear data structure. It is having a list of items in which each item has associated priority. It works on a principle add an element to the queue with an associated priority and remove the element from the queue that has the highest priority. In general different items may have different priorities.

Wednesday, December 5, 2007

Queue Data Structure

  • Queue is a linear data structure
  • it works on the principle First In First Out (FIFO).
  • The first element insert into the queue is the first element to be delete
  • Insertion can be done at rear end using rear pointer and deletions can be done at front end using front pointer
  • It looks like open tube.

 
^ Scroll to Top