# Queue Basics
Queue is a linear data structure which follows FIFO i.e. First-In-First-Out method.
That is the data/element which is stored first in the queue will be accessed first.
The two ends of a queue are called Front and Rear.
Insertion takes place at the Rear and the elements are accessed or removed from the Front.
Suppose we take an example of people standing in a queue at an ATM, then the person at front will access the ATM first and then the second person and so on.
Any new person coming will join the queue at the end i.e rear.
Applications of queues in computer world :
- Scheduling : CPU Scheduling , Job Scheduling.
- Buffers : I/O Buffers.
Example: Printer schedules all the jobs in a queue and prints them one by one.
Operations
enqueue()
: Insertion of new element in queue.dequeue(
: Removal of element at front from queue.showfront()
: To show the element at front.isempty()
: To check if queue is empty.