Queues
- FIFO queue ADT
- Examples using queues
– reading character string in order – recognize palindromes
- Queue implementations
– LL pointer based – List ADT based – array based – tradeoffs
EECS 268 Programming II 1
Queues FIFO queue ADT Examples using queues reading character - - PowerPoint PPT Presentation
Queues FIFO queue ADT Examples using queues reading character string in order recognize palindromes Queue implementations LL pointer based List ADT based array based tradeoffs EECS 268 Programming II 1 The
EECS 268 Programming II 1
2 EECS 268 Programming II
3 EECS 268 Programming II
4 EECS 268 Programming II
EECS 268 Programming II 5
Figure 7-2 Some queue operations
6 EECS 268 Programming II
7 EECS 268 Programming II
8
see C7-palin.cpp
EECS 268 Programming II
9 EECS 268 Programming II
10
Figure 7-4 A pointer-based implementation of a queue: (a) a linear linked list with two external pointers; (b) a circular linear linked list with one external pointer
EECS 268 Programming II
11
Figure 7-7 Deleting an item from a queue of more than one item Figure 7-6 Inserting an item into an empty queue: (a) before insertion; (b) after insertion Figure 7-5 Inserting an item into a nonempty queue
see C7-QueueP.cpp
12
see C7-QueueL.cpp
EECS 268 Programming II
13 EECS 268 Programming II
14 EECS 268 Programming II
15
see C7-QueueA.cpp
EECS 268 Programming II
16 EECS 268 Programming II
17 EECS 268 Programming II
18 EECS 268 Programming II
19 EECS 268 Programming II
20 EECS 268 Programming II