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

  1. Infix Expression: The operator is in between the two operands. Example: A + B is known as infix expression.

  2. Postfix Expression: The operator is after the two operands. Example: BD + is known as postfix expression.

  3. Prefix Expression: The operator is before the two operands. Example: + BD is known as prefix expression.

Programs:

Last updated