Skip to content

This repository contains the push_swap project that I developed as a Student of 42 Malaga. It is about ordering the numbers contained in a stack with the minimum number of movements posible using only certain allowed actions.

License

Notifications You must be signed in to change notification settings

jandrana/push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push_swap

This repository contains the push_swap project that I developed as a Student of 42 Malaga.

Introduction

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.

Experience

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)

Project structure

...

Usage

Supported platforms

  • Linux
  • macOS

Prerequisites

Before using the push_swap program, you need:

  • GCC: The GNU Compiler Collection

Example of usage

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

About

This repository contains the push_swap project that I developed as a Student of 42 Malaga. It is about ordering the numbers contained in a stack with the minimum number of movements posible using only certain allowed actions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published