Home | Projects | Notes > Data Structures & Algorithms > Queues

Queues

 

Introduction

A queue is a linear data structure that follows the First In, First Out (FIFO) principle. Elements are added at the back (enqueue) and removed from the front (dequeue). It is commonly used in scheduling, buffering, and breadth-first traversal scenarios.

 

queue-using-singly-linked-list

 

Pros:

Cons:

Compared to Stacks:

 

Implementation (C++)

Header (queue.hpp)

Source (queue.cpp)

Test Driver