Skip to content

0x1ceW4rd/Push_Swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by aezzirar.

Push_Swap

Because Swap_push doesn’t feel as natural


Description

push_swap is an algorithmic project whose goal is to sort a stack of integers using a very limited set of operations and the smallest possible number of moves.

The program receives a list of integers as arguments, stores them in stack A, and outputs a sequence of instructions that will sort the stack in ascending order. A second stack (stack B) is available as additional storage.

The main challenge of this project is not only to sort the numbers, but to do so efficiently, by choosing and implementing appropriate algorithms depending on the input size.

This project focuses on:

  • Algorithmic thinking
  • Time and operation complexity
  • Data structures

Instructions

Compilation

Run make in the root directory to compile the push_swap program.
If you want to compile the bonus checker program, run make bonus.

Usage

./push_swap [list of integers]

Resources

Peers ;)
YouTube
Reddit
DeepSeek

AI usage

AI was used in the following ways:
Brainstorming algorithm approaches; to explore different sorting strategies suitable for two-stack constraints.
Debugging assistance; to identify edge cases and memory issues during development.
Code review suggestions; to improve code structure and readability.
All AI-generated content was reviewed, tested, and understood before integration.

About

Because Swap_push doesn’t feel as natural

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors