introduction to queues

Last Updated on

queue is one type of linear data structure, it follows (FIFO) first in first out. the elements which are inserted first, that element will be removed first

let’s look into a real-time example

in the below image, some persons are waiting in queue for tickets, the first get tickets and goes out from the line

in the queue, there are two operations

  1. Enqueue (Insertion)
  2. Dequeue (Removal)
queues example visual