The task is to sort numbers using 2 stacks. But, only with operations allowed on stack: push
, swap
, rotate
, reverse rotate
. Programming language must be C.
- Enjoyed implementing Stack data structure on my own.
- Finding an algorithm best for the requirenment.
- make
- ./push_swap "5 12 1 44 88 121 ..." (this will print which steps will sort the sequence)
To check if the sequence will be sorted: (checker was made for Mac)
- ./push_swap "5 12 1 44 88 121 ..." | ./checker_Mac "5 12 1 44 88 121 ..." (it will output if it was sorted or not)