Queue is a basic data structure in which an element in inserted from the one end(REAR) and removed from the other end(FRONT). This makes queue as First-In-First-Out(FIFO) data structure, which means that element inserted first will also be removed first. Queue, in real life could be related to a line of people waiting at bus stand. First person standing in line will be first to get in and any new person will be added behind. Another good example is the printer queue, the first job sent to printer will always be printed first.
There are mainly 2 functions that are performed on queue
Implementation details: Queue can be implemented using LinkedList or Arrays.