1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Queue
is a linear data structure that follows FIFO (First In, First Out).
Enqueue()
Adding element at the REAR
Dequeue()
Removing element at the FRONT
First()
returns first element without removing
Size()
returns number of elements
Is Empty()
checks if queue has no elements (size)
Is Full()
checks if queue reached capacity (maximum capacity)
Basic Queue
one direction
Circular Queue
connects last position to first
Advantages:
- Efficient memory usage
- Reuses freed space
- Continuous operations
Deque (Double-Ended Queue)
Insert and remove from BOTH ends
Importance:
- Organizes data (FIFO)
- Used in real systems
- Controls process flow
- Improves efficiency
Is Empty() Checks if Size == 0 TRUE → Empty FALSE → Not Empty
is empty reminder
Front = Front + 1 Size = Size - 1
dequeue reminder
Rear = Rear + 1 Size = Size + 1
enqueue reminder
EMPTY If Size = 0,
FULL (not ISFULL),
If Size = Maximum Array Size
reminder about empty, full and size
Is Full() Checks if Size == Maximum Array Size TRUE → Full FALSE → Not Full
if full reminder