Stacks
- The stack ADT
- Stack Implementation
– using arrays – using generic linked lists – using List ADT
- Stack Examples
EECS 268 Programming II 1
Stacks The stack ADT Stack Implementation using arrays using - - PowerPoint PPT Presentation
Stacks The stack ADT Stack Implementation using arrays using generic linked lists using List ADT Stack Examples EECS 268 Programming II 1 Stacks and Queues Linear data structures each item has specific first , next
EECS 268 Programming II 1
2 EECS 268 Programming II
3 EECS 268 Programming II
4
5 EECS 268 Programming II
6 EECS 268 Programming II
7
see C6-reverseList.cpp
EECS 268 Programming II
8 EECS 268 Programming II
9 EECS 268 Programming II
10 EECS 268 Programming II
11
see C6-strRecog.cpp
EECS 268 Programming II
12 EECS 268 Programming II
13
Figure 6-4 Implementations of the ADT stack that use (a) an array; (b) a linked list; (c) an ADT list
14
Figure 6-5 An array-based implementation
see C6-StackA.cpp
15
see C6-StackP.cpp
16
see C6-StackL.cpp
EECS 268 Programming II
17 EECS 268 Programming II
18 EECS 268 Programming II
19 EECS 268 Programming II
20 EECS 268 Programming II
21 EECS 268 Programming II
22 EECS 268 Programming II
23 EECS 268 Programming II
24
see C6-InfixEval.cpp
EECS 268 Programming II
25 EECS 268 Programming II
26 EECS 268 Programming II
27 EECS 268 Programming II
28 EECS 268 Programming II
29 EECS 268 Programming II
searchR(in originCity:City, in destinationCity:City):boolean Mark originCity as visited if (originCity is destinationCity) Terminate -- the destination is reached else for (each unvisited city C adjacent to
searchR(C, destinationCity)
30 EECS 268 Programming II
31 EECS 268 Programming II
32 EECS 268 Programming II