Back to Blog
1 min read August 21, 2021

Queue Data Structure

V

Velda Kiara

Creative Engineer

Queues use FIFO (First In First Out) principle, which means the first one to queue gets to leave the queue first. The act of queueing in data structures is called enqueue while the act of leaving the queue is called dequeue. Adding elements in a queue takes place in the rear while removing elements take place in the front.

Common operations in queues are:

Types of queues

-Simple queue: items are added in the rear and removed in the front

-Circular queue: the last element points to the first element hence making it a circular link. E.g if in the bus terminal the bus is full, the person left behind becomes the first person and the cycle continues.

-Priority queue: items are given priorities and served according to their level of priority. e.g in airports where some passengers get shorter lines and faster service

-Double-ended queue: items can be added and removed from either front or rear

Queue Application

More to read

Enjoying my work? Buy me a piping hot chocolate

All photographs on this page were taken by V.Kiara — if you'd like to use them, please reach out first.