A sort algorithm using two stacks with a limited set of instructions.
- ✍🏻 Created by Mathis Martini.
- 📫 How to reach me: contact@mathis-martini.fr.
- 📫 How to reach me in 42: mathmart@student.42lyon.fr.
- 👨🏻💻 Login 42Intra: mathmart
To compile programs:
make
To compile push_swap program:
make push_swap
To recompile programs:
make re
To clean all *.o in project and libraries:
make clean
To clean all *.o and compiled things in project and libraries:
make fclean
Run push_swap:
./push_swap <number_1> <number_2> <number_3> ... <number_n> (Numbers should be between INT_MIN (-2147483648) and INT_MAX (2147483647))
Then write actions into STDIN. When terminated press CTRL+D to write EOF. The checker will display if numbers are correctly sorted.
Run push_swap and check if the algorithm sort numbers correctly:
ARG="<number_1> <number_2> <number_3> ... <number_n>" ; ./push_swap $ARG | ./checker $ARG
Visualize:
With random values: python3 pyviz.py `ruby -e "puts (-200..200).to_a.shuffle.join(' ')"`
This is o-reo's visualizer, check his work: Visualizer repository.
Mathis Martini (mmartini42) © 2022