🌐 Available in: English | Italiano
C program that sorts a stack of integers using only a limited set of operations on two stacks (a and b). The goal is to minimize the number of moves while following the 42 project rules.
- Core operations:
sa sb ss pa pb ra rb rra rrb rrr - Strategies for tiny inputs (e.g., 3/5 elements) and larger sets
- Input parsing, validation, and robust error handling
- Algorithm design and complexity analysis
- Data structures (stacks) and move optimization
- Modular, testable C code
make
./push_swap "2 1 3 6 5 8"
Topics / Keywords
C, algorithms, sorting, stack, push-swap, 42school