Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Description

Push_swap is a sorting algorithm project designed for the 42 curriculum. The goal is to sort a stack of integers using a limited set of operations (push, swap, rotate, reverse rotate) with the minimum number of moves. The project focuses on algorithmic efficiency, data structure manipulation, and code style compliance.

Instructions

Compilation

To compile the project, run:

make

Usage

After compilation, execute the program with a list of integers:

./push_swap 3 2 1

You can also provide numbers as quoted strings:

./push_swap "3 2 1"

Resources

AI Usage

AI (GPT) was used for:

  • Code style corrections and norminette compliance
  • Refactoring functions for line and variable limits
  • Improving algorithm efficiency and edge case handling

Features

  • Handles all valid integer inputs
  • Detects and reports errors (duplicates, invalid input)
  • Efficient sorting for small and large stacks
  • Modular code structure

Technical Choices

  • Written in C
  • Uses linked lists for stack representation
  • Follows 42 Norminette style guide

Example

./push_swap 4 67 3 87 23

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages