Skip to content

phijano/push_swap

Repository files navigation

push_swap

Learning proyect - 42 Málaga

Description

This proyect is about sorting numbers, there are two stacks and some actions to manipulate the numbers in the stacks.

The problem start with one stack (stack A) filled with numbers and the objetive is to use the following actions to sort them:

sa -> swap the 2 first numbers in stack A.

sb -> swap the 2 first numbers in stack B.

ss -> sa + sb at the same time.

pa -> push the first number in stack B to the top of stack A.

pb -> push the first number in stack A to the top of stack B.

ra -> moves up all the numbers in stack A one position, the first number will become the last.

rb -> moves up all the numbers in stack B one position, the first number will become the last.

rr -> ra + rb at the same time.

rra -> moves down all the numbers in stack A one position, the last number will become the first.

rrb -> moves down all the numbers in stack B one position, the last number will become the first.

rrr -> rra + rrb at the same time

About

learning proyect - 42 Málaga

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published