queue queue is an abstract data structuresomewhat similar to stacks unlike stacksa queue is open at both its ends one end is always used to insert data (enqueueand the other is used to remove data (dequeuequeue follows first-in-first-out methodologyi the data item stored first will be accessed first real-world example of queue can be single-lane one-way roadwhere the vehicle enters firstexits first more real-world examples can be seen as queues at the ticket windows and busstops queue representation as we now understand that in queuewe access both ends for different reasons the following diagram given below tries to explain queue representation as data structure as in stacksa queue can also be implemented using arrayslinked-listspointers and structures for the sake of simplicitywe shall implement queues using one-dimensional array basic operations queue operations may involve initializing or defining the queueutilizing itand then completely erasing it from the memory here we shall try to understand the basic operations associated with queues enqueue(add (storean item to the queue dequeue(remove (accessan item from the queue few more functions are required to make the above-mentioned queue operation efficient these are peek(gets the element at the front of the queue without removing it isfull(checks if the queue is full isempty(checks if the queue is empty in queuewe always dequeue (or accessdatapointed by front pointer and while enqueing (or storingdata in the queue we take help of rear pointer let' first learn about supportive functions of queue peek(