# CS 112

Lecture 10

Stacks

Applications of Stacks

## Stacks

- The
Stack abstract data type.
- The Stack C++ class (header file and the skeleta of the
implementation
file and the testdriver.
- More general stacks, independent of the type of data:
templated classes. Templated Stack

## Applications of Stacks

- Evaluating arithmetic expressions. A special notation easily
understood by computers:
**Reverse Polish Notation**.
- We'll get back to this topic later in a few weeks, and you
will implement the algorithm to convert an arithmetic expression
to postfix form (and more).
- We'll see more about trees in a few weeks - and you will
implement this data structure.

**Warning:**
The topics covered in these lectures are VERY important. Without a clear
understanding of these applications of stacks, you might have
serious difficulty in this class from now on. Please stop me,
ask frequent questions, work out examples on your own after
class, come to my office hours and make sure everything is absolutely
clear before the exam. The next homework will be a
relatively challenging one and requires thorough understanding of
these concepts.

Ileana Streinu