(Latest Revision: 10/30/2000)
Week 09 Notes for CS 2500 -- Fall 2000
Monday, October 30
- Take Roll.
- Check out this week's schedule
- Announcement(s)
- I graded program #2, posted aggregate
results, and e-mailed individual score
sheets.
-
- Discuss some low-level aspects of the program design.
- Discuss applications of the stack data type
- Evaluating postfix expressions
- "Towers of Hanoi" puzzle program
- depth-first search
Wednesday, November 01
- Take Roll.
- Check out this week's schedule
- Announcement(s)
- Discuss Definition of the stack data type
- Organization -- Last-In, First-Out
- Elements -- any given homogeneous set
- Operations
- constructor(s)
- destructor(s)
- bool StackIsEmpty()
- void Push(stackItemType NewItem, bool& Success)
- void Pop(bool& Success)
- void Pop(stackItemType& StackTop, bool& Success)
- void GetStackTop(stackItemType& StackTop, bool& Success)
- Discuss applications of the stack data type
- Evaluating postfix expressions
- "Towers of Hanoi" puzzle program
- depth-first search
- Discuss implementations of the stack data type
- array-based implementation
- pointer-based implementation
- "as-a-list" implementations
- Discuss pro's and con's of different implementations
- array-based implementation
- PRO: simple code
- PRO: all operations are O(1)
- CON: static allocation
- pointer-based implementation
- PRO: dynamic memory allocation
- PRO: most operations are O(1)
- CON: destructor is O(N)
- CON: extra memory required for each element.
- "as-a-list" implementations
- PRO: extremely easy to program
- PRO: if done a certain way, can be as efficient as
coding "from scratch."
- PRO: can be done with an array-based list or with a
pointer-based list.
-
Friday, November 03
- Take Roll.
- Check out this week's schedule
- Announcement(s)
-