Академический Документы
Профессиональный Документы
Культура Документы
(Chapter 5)
Outline
Introduction
Operations on queues
Queue implementation
Implementation of insert and delete operations on a queue
Limitations of linear queues
Circular queues
Data objects:
A finite set of elements of the same type
Operations:
Create an empty queue and initialize front and rear variables of
the queue
CREATE ( QUEUE, FRONT, REAR)
Check if queue QUEUE is empty
CHK_QUEUE_EMPTY (QUEUE ) (Boolean function)
Check if queue QUEUE is full
CHK_QUEUE_FULL (QUEUE) (Boolean function)
Insert ITEM into rear of queue QUEUE
ENQUEUE (QUEUE, ITEM)
Delete element from the front of queue QUEUE and output the
element deleted in ITEM
DEQUEUE (QUEUE , ITEM)