Push Swap is an algorithmic project within the study program at School 42 (UNIT Factory). The main objective is to sort data using a stack and a limited set of instructions while minimizing the number of actions required.
Goal: Sort a set of integers using two stacks (named βaβ and βbβ) and a predefined set of instructions.
sa : Swap the first 2 elements at the top of stack βaβ.
sb : Swap the first 2 elements at the top of stack βbβ.
ss : Perform sa and sb simultaneously.
pa : Push the first element from stack βbβ to stack βaβ.
pb : Push the first element from stack βaβ to stack βbβ.
ra : Rotate all elements of stack βaβ (shift up by 1).
rb : Rotate all elements of stack βbβ (shift up by 1).
rr : Perform ra and rb simultaneously.
rra: Reverse rotate stack βaβ (shift down by 1).
rrb: Reverse rotate stack βbβ (shift down by 1).
rrr: Perform rra and rrb simultaneously.\
git clone https://github.com/rabatm/42_push_swap.git
cd 42_push_swap
make
42_push_swap is licensed under MIT License. See LICENSE for full details.
rabatm - https://github.com/rabatm
Please note that all functions are created in accordance with the Norm β a set of rules governing code formatting at School 42.
Happy sorting! π