This repository contains the push_swap project that I developed as a Student of 42 Malaga.
The push_swap
project is a fundamental algorithmic challenge where you have to sort data in the most effective way possible. You're given a stack of integers, two stacks to manipulate, and a limited set of actions. The objective is to write a C program called push_swap
that calculates and displays the smallest set of actions necessary to sort the initial stack. Developed within the project's guidelines, my program efficiently sorts the provided input.
Being able to complete this project meant a big step forward in my learning path since I consider it to be much more difficult that any other projects that I have developed in C so far. I believe it is the project I learnt the most from and it is definitely the one I have enjoyed most so far.
Things to highlight as learnt with this project:
- Development, optimization and implementation of sorting algorithms
- Utilization and deeper comprehension of data structures (double linked lists)
...
- Linux
- macOS
Before using the push_swap program, you need:
- GCC: The GNU Compiler Collection
Compile the program:
make all
- Set the numbers you want to order:
ARG="9 3 2"
- Execute the program
./push_swap $ARG
Output:
ra
sa