Skip to content

rabatm/42_push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Push Swap: An Algorithmic Project

Push Swap is an algorithmic project within the study program at School 42 (UNIT Factory). The main objective is to sort data using a stack and a limited set of instructions while minimizing the number of actions required.

Project Overview

Goal: Sort a set of integers using two stacks (named β€˜a’ and β€˜b’) and a predefined set of instructions.

Instructions:

sa : Swap the first 2 elements at the top of stack β€˜a’.
sb : Swap the first 2 elements at the top of stack β€˜b’.
ss : Perform sa and sb simultaneously.
pa : Push the first element from stack β€˜b’ to stack β€˜a’.
pb : Push the first element from stack β€˜a’ to stack β€˜b’.
ra : Rotate all elements of stack β€˜a’ (shift up by 1).
rb : Rotate all elements of stack β€˜b’ (shift up by 1).
rr : Perform ra and rb simultaneously.
rra: Reverse rotate stack β€˜a’ (shift down by 1).
rrb: Reverse rotate stack β€˜b’ (shift down by 1).
rrr: Perform rra and rrb simultaneously.\

Installation

Clone the repository:

git clone https://github.com/rabatm/42_push_swap.git
cd 42_push_swap

Compile the project:

make

License

42_push_swap is licensed under MIT License. See LICENSE for full details.

Authors

rabatm - https://github.com/rabatm

Please note that all functions are created in accordance with the Norm – a set of rules governing code formatting at School 42.
Happy sorting! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published