DATA STRUCTURES AND ALGORITHMS SESSION 5 PPT. pptx
AustindelaCruz1
0 views
17 slides
Oct 10, 2025
Slide 1 of 17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
About This Presentation
Queues – Queue Operations and Circular Queues
Size: 231.23 KB
Language: en
Added: Oct 10, 2025
Slides: 17 pages
Slide Content
Queues – Queue Operations and Circular Queues
1. What is the difference between a stack and a queue?
A stack follows LIFO (Last In, First Out) order, meaning the last element added is the first one removed. A queue follows FIFO (First In, First Out) order, meaning the first element added is the first one removed.
2. In a queue, which element is removed first?
The first element inserted (front element) is removed first, following the FIFO principle.
3. Define enqueue operation.
Enqueue is the operation of inserting (adding) an element at the rear (end) of the queue.
4. What type of queue allows reusing empty spaces at the front?
A circular queue allows reusing empty spaces at the front once elements have been dequeued , preventing wasted memory.
5. True or False: A queue follows LIFO order.
False. A queue follows FIFO (First In, First Out) order, not LIFO.
Have you ever lined up in a cafeteria or a ticket booth? How does it relate to how data is processed in queues?