This project is about using two stacks A and B, as well as a few pre-selected stack operations to sort a list of unsorted integers. From this project, I learnt how to implement doubly linked lists in the context of stacks and stack operations / manipulation and a general overview of different types of sorts and their time and space complexities.
https://github.com/laisarena/push_swap_tester
https://github.com/gemartin99/Push-Swap-Tester
https://github.com/louisabricot/push_swap_tester
https://md.picasoft.net/ygePDdPSR4KN1PzJ50KHaw?view
100 numbers: https://tinyurl.com/100numsort
500 numbers: https://tinyurl.com/500numsort
- Clone the repository
git clone https://github.com/rsoo23/push_swap.git push_swap
- Make the executable
make
- Input the arguments (int must be within the int range) (redirect the output into an output file)
./push_swap "int int ..." > out
- Go to the website below, copy and paste the unsorted numbers and the moves from the output file into the respective fields
https://codepen.io/ahkoh/full/bGWxmVz
A checker that takes in the list of unsorted numbers and takes in moves to check if the moves sort the list
- Make the checker executable
make bonus
- Input the arguments and press enter (int must be within the int range)
./push_swap "int int ..."
- Enter your moves (press enter after every new move)
./push_swap "int int ..."
rra
sa
- Press Ctrl + D to end the instruction reading and get the result (OK = sorted / KO = not sorted)
./push_swap "int int ..."
rra
sa
KO / OK