Skip to content

ImanSafae/PUSH_SWAP

Repository files navigation

PUSH_SWAP

This program is the school 42 push_swap project.

Its goal is to sort a list of integers with the help of two stacks (with a LIFO principle), and the following operations :

  • push A or push B : pushes top element from stack B towards stack A (or vice versa)
  • rotate A or rotate B : first element of stack A (or B) becomes the last one
  • reverse rotate A or reverse rotate B : last element of stack A (or B) becomes the first one
  • swap A or swap B : swaps the first two elements of stack A (or B).

All integers must be sorted in order (biggest one at the bottom) in stack A and with a minimal amount of operations.

This program allowed me to validate this project with a score of 82/100 and does not include the bonus checker.

About

A first sorting algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors