Title: Queues
1Queues
- A first-in, first-out or FIFO data structure.
- Basic operations enqueue, Dequeue and Head.
2Implementation
- Array based
- Pointer based (using linked list)
3Basic Queue Operations
4Queue Class Definition
5Array Implementation
6Array Implementation of a queue
7Constructor, Destructor and Purge()
8Head, Enqueue, and Dequeue
9Linked-List Implementation
10Constructor, Destructor and Purge()
11Head, Enqueue and Dequeue
12Deques
- Double-ended queue.
- Insert and remove items at both ends of the pile.
13Basic Operations
14Deque Class Definition
15Enqueue and Dequeue
16Specialization and Generalization
- Specialization
- Base class is general, derived class is
restricted. - class Queue public Deque
- Generalization
- Base class is restricted, derived class is
general. - class Deque public Queue
17Array Implementation
18Head(), EnqueueHead(), DequeueHead()
19Tail(), EnqueueTail() DequeueTail()
20Linked-List Implementation
21Head(), EnqueueHead() and DequeueHead()
22Tail() EnqueueTail() and DequeueTail()
23Doubly-Linked and Circular Lists