A Stack is a linear data structure that follows the principle LIFO (Last In First Out).
Associativity defines the order in which operators of the same precedence are evaluated in an expression.
Examples:
| Precedence | Operators | Associativity |
|---|---|---|
| Highest | ( ) | — |
| 2 | ^ | Right to Left |
| 3 | * / | Left to Right |
| Lowest | + - | Left to Right |
Infix Expression
Postfix Expression
Prefix Expression