420 likes | 526 Views
In the last problem:Remainders are generated in right-to-left order. We need to "stack" them up, then print them out from top to bottom.. In these problems we need a"last-discarded-first-removed,""last-pushed-onto-first-removed," "last-stored-first-removed, " "last-generated-first-displayed"
E N D
1. Chapter 4: Stacks
2. LIFO
3. Stack as an ADT
4. Example use of Stack
5. Example (contd.)
6. Base10 to Base2 Conversion
8. Building a Stack Class
9. Stack Operations:
10. 2. Implementing a Stack Class
11. Implementing Stack Class Refined
12. Stack's Data Members
13. Notes
15. Stack.h
16. Stack.h (contd.)
17. Stack's Function Members
18. A sample declaration
19. Empty Member Function
20. Test Driver Program
21. Push member function
22. Add to Stack.cpp
23. Build the Test Driver AS you build the program itself:
24. Display: So we can test our operations.
26. Top Member Function
27. Add to Stack.cpp:
28. Pop Member Function
29. Pop (contd.)
30. Application of Stacks: Run-time Stack
32. Run-time Stack Process
34. Application of Stacks: RPN
35. Evaluating RPN Expressions
37. Sample RPN Evaluation (p. 196)
38. Unary minus causes problems
39. Converting Infix to RPN