Push Swap

What is the project about?

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.

What have I learned and liked implementing the project?

  • Enjoyed implementing Stack data structure on my own.
  • Finding an algorithm best for the requirenment.

Instructions for running

  1. make
  2. ./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)

  1. ./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)

Visual review of algorithm used

Screen.Recording.2023-10-24.at.11.03.38.AM.mov