
156 Data Structures Using C
4.2 APPLICATIONS OF STACKS
The stacks are used in numerous applications and some of them are as follows:
n Arithmetic expression evaluation
n Undo operation of a document editor or a similar environment
n Implementation of recursive procedures
n Backtracking
n Keeping track of page-visited history of a web user
4.2.1 Arithmetic Expressions
An arithmetic expression is a combination of variables
and/or constants connected by arithmetic operators and
parenthesis. The valid arithmetic operators are given in
Table 4.1.
The rules for an arithmetic expression are:
n A signed or unsigned variable or constant ...