Professional Documents
Culture Documents
Data Structures: Queues
Data Structures: Queues
Data Structures: Queues
Queues
DATA
STRUCTURES
QUEUES
Head:
Tail:
All items are
All new items
deleted from
are added on
this end
this end
OPERATIONS ON QUEUES
• Linked Implementation
• Array-Based Queue Implementation
Array-Based Queue Implementation
tail head
49 48 47 4 3 2 1 0
• Next insertion goes into slot 0, and tail tracks it. The
insertion after that goes into a lot 1, etc.
A CIRCULAR QUEUE
49 48 47 4 3 2 1 0
• Next insertion goes into slot 0, and tail tracks it. The insertion after
that goes into a lot 1, etc.
ILLUSTRATION OF CIRCULAR QUEUES
• Current state: head
49 48 47 4 3 2 1 0
tail
49 48 47 4 3 2 1 0
49 48 47 4 3 2 1 0
NUMERICS FOR CIRCULAR QUEUES