# Stack

```README
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:

* [Stack implementation](https://github.com/sthsuyash/CSIT_Labs/blob/main/3rd_Semester/DSA/2_Stack/stack.cpp)
* [Infix to Prefix Expression](https://github.com/sthsuyash/CSIT_Labs/blob/main/3rd_Semester/DSA/2_Stack/infix_to_prefix_expression.cpp)
* [Infix to Postfix Expression](https://github.com/sthsuyash/CSIT_Labs/blob/main/3rd_Semester/DSA/2_Stack/infix_to_postfix_expression.cpp)
* [Prefix evaluation](https://github.com/sthsuyash/CSIT_Labs/blob/main/3rd_Semester/DSA/2_Stack/prefix_evaluation.cpp)
* [Postfix evaluation](https://github.com/sthsuyash/CSIT_Labs/blob/main/3rd_Semester/DSA/2_Stack/postfix_evaluation.cpp)
