Queues in Python
Queues in Python
1
A Queue is a linear data structure that
Definition of follows the First In First Out (FIFO)
principle. Elements are added from one
Queue end, known as the rear, and removed
from the other end, known as the front.
2
Consider a queue of people
waiting in line for a ticket. The
person who arrives first gets
Example: served first, and the person
who arrives last will be served
last.
3
Types of
Queues
4
Simple queue
Types of
QUEUE Circular queue
Priority of queue
5
Simple
queue
A simple queue, also
known as a linear queue, is a
straightforward data structure
that operates on the principle
of FIFO(First In, First Out).
Elements are inserted at the
rear end and removed from
the front end.
6
Circular Queue
• In a circular queue, the last element is connected to the first element, forming
a circular structure that aids in efficient space utilization.
7
Priority Queue
8
Double-ended Queue (Deque)
• A deque allows insertion and deletion of elements from both the front and
rear, offering flexibility in managing data.
9
Queue with Linked List
• This queue is built using a linked list, where each element points to the next,
enabling dynamic memory allocation and efficient data manipulation.
10
Queue Implementation in Python
11
Our competition
12
Queue Implementation in Python
Taguitag, Lutwache
Jojo n, Karylle
Buyacao,
Daskeo,
Sean
Aliyaj
Francis