Stacks

2
Stacks

description

Stacks

Transcript of Stacks

Page 1: Stacks

Stacks

Page 2: Stacks

• Many applications naturally use stacks in programming:• In the system: method calls and returns -- track points of return for

each call• Parsing expressions in context-free programming languages; nested

languages/control structures• Translating infix (algebraic) expressions to postfix and evaluating

postfix expressions (interpreter for arithmetic expressions)• "Undo" features in word processing, etc.• Maintaining link histories in a web browser (for support of

the back operation)• Stack -> email inboxes

Properties: - The one that was sent last will stay on the top in the inbox