Stack data structure problems and applications.
- LIFO (Last In First Out) principle
- Stack implementation (array and linked list)
- Monotonic stack technique
- Expression evaluation
- Parentheses matching
- Next/Previous greater/smaller element
- Histogram problems
- stack_bal_paranths - Balanced parentheses
- BalancedParanthesis - Balanced parenthesis checker
- checkParenthesis - Check parentheses validity
- stack_greaterleft - Next greater element to left
- stack_smallerleft - Next smaller element to left
- stack_largest_rect_histo - Largest rectangle in histogram
- stack_char_troub - Character troubleshooting
- stackunwindind - Stack unwinding
- stackunwinding - Stack unwinding (exception handling)
- Think of stack for "most recent" problems
- Use monotonic stack for next/previous element problems
- Stack is great for parsing and validation
- Can often optimize O(n²) nested loops to O(n)