Because Swap_push isn’t as natural
It sorts the array of numbers using two stack and a limited set of operations on those stacks
The program itself is written in C, the visualisation - in Python
To get this thing up and running
- clone the repository and run
make
- Then you need to check if you have python3 env and install it id needed (with
brew
, for instance) You may also get issues withtkinter
(python graphic lib used for visualisation), in this case
you may need to runbrew install python-tk@3.9
(or your actual python version instead of 3.9) - Run
./push_swap $ARG | ./visual.py $ARG
, where ARG is an array of random numbers, like7 1 3 4 12
You can also usechecker
to the correct execution ofpush_swap
, andanalyzer
to run it through
some tests and get some info numbers about it.