Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🌐 Available in: English | Italiano

🔀 push_swap

Description

C program that sorts a stack of integers using only a limited set of operations on two stacks (a and b). The goal is to minimize the number of moves while following the 42 project rules.

Features

  • Core operations: sa sb ss pa pb ra rb rra rrb rrr
  • Strategies for tiny inputs (e.g., 3/5 elements) and larger sets
  • Input parsing, validation, and robust error handling

Skills gained

  • Algorithm design and complexity analysis
  • Data structures (stacks) and move optimization
  • Modular, testable C code

Build

make
./push_swap "2 1 3 6 5 8"

Topics / Keywords

C, algorithms, sorting, stack, push-swap, 42school