Expression Evaluation
Two stacks, values and operators, evaluate infix in one pass. Brackets fence the operator stack.
Stacks for Expressions: Evaluate infix with two stacks
'('. An opening bracket fences the operator stack.
Cost
- Best
- O(n)
- Average
- O(n)
- Worst
- O(n)
- Space
- O(n)
Before this
Related
Leads to
Topics that need this one first.
Taught by the same lesson
Stacks for Expressions covers these too, in the same run.