Stack
A "stack" is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc. A real-world stack allows operations at one end only.
It has one ended operation defined on it and follows LIFO structure (Last In First Out).
Types of Expression
Infix Expression:
The operator is in between the two operands.
Example: A + B is known as infix expression.Postfix Expression:
The operator is after the two operands.
Example: BD + is known as postfix expression.Prefix Expression:
The operator is before the two operands.
Example: + BD is known as prefix expression.
Programs:
Last updated
Was this helpful?