QUEUE :- queue as FIFO(First in First Out) data structure, which means that element inserted first will be removed first.
Which is exactly how queue system works in real world. If you go to a ticket counter to buy movie tickets, and are first in the queue, then you will be the first one to get the tickets. Right? Same is the case with Queue data structure. Data inserted first, will leave the queue first.
ENQUEUE:- The process to add an element into queue is called Enqueue
DEQUEURE:- The process of removal of an element from queue is called Dequeue.
When the above program is executed, it produces following results --
0 Comments