Skip to main content

Posts

Showing posts from April, 2019

Definition of Queue and its types with algorithms (Data structure)

                                 Queue  A queue is non-premitive linear data structure . It is based on first-in-first-out (FIFO) mechanism.In queue deletion can take place at one end of the list , the front of the list. And insertion can take place at the other end of the list , rear of the list.     Queues are often usde in programming networks , operating systems , and other situations in which many different processes must share resources such as CPU time. * Working Process on Queue :- By incrementing rear pointer we can insert an element in queue. By incrementing front pointer we can removew element from queue. If queue is empty then front and rear pointer must be incremented by 1 first time. When rear=size- 1 then queue is full. When front=rear then reset front=-1 and rear=-1. When front=rear=-1 then the queue is empty. Queue is different from stack in many cases. Both are  non-premitive linear data structure but the mechanisms on insertion and dele