Python Notes for mca i year students osmania university.docx
Chapter 7: Queue data structure
1. DATA STRUCTURE
Chapter 7: Queue
Prepared & Presented by
Mr. Mahmoud R. Alfarra
2011-2012
College of Science & Technology
Dep. Of Computer Science & IT
BCs of Information Technology
http://mfarra.cst.ps
2. Out Line
What is Queue data structure?
EnQueue operation
DeQueue operation
Clear the Queue
Print all data of Queue
Search about data
Queue Class
Types of Queue
2
3. What is Queue data
structure?
Queues are used to prioritize operating system
processes and to simulate events in the real
world, such as teller lines at banks and the
operation of elevators in buildings.
A queue is a data structure where data enters at
the rear of a list and is removed from the front of
the list.
Queues are an example of a first-in, first-out
(FIFO) data structure.
3
Mohame
d
Ghadeer
Ali
Ahmed
Hussam
Rear Front
4. Queue Operations
The two primary operations involving queues
are adding a new item to the queue and
removing an item from the queue.
The operation for adding a new item is called
Enqueue, and the operation for removing an
item from a queue is called Dequeue.
The other primary operation (The Peek
method) to perform on a queue is viewing the
beginning
item.
4