Program to sort stack of numbers in ascending order with help of one extra stack
The Push swap project is a very simple and a highly straightforward algorithm project: data must be sorted. A set of integer values, 2 stacks, and a set of instructions to manipulate both stacks are available. The goal is to write a program in C called push_swap which calculates and displays on the standard output the smallest program, made of Push swap language instructions, that sorts the integers received as arguments.
- clone
- make
- run with bash: ./push_swap your numbers separated by space
- if the sequence is already sorted in ascending order - it won't return anything!
- I used an algorithm described in this guide.
- To test the algorithm I've used that visualizer.