Skip to content

Ahaif/Push_swap

Repository files navigation

Push_swap

Algorithmetic Project with Language C

Implementation of a non-recursive quick-sort algorithm in best case to sort one stack by use of another stack.

The aim of push swap is to sort a stack of numbers using another stack in the least commands possible. The educational aim of the project was to introduce students to advanced sorting algorithms and the concept of complexity. This project earned maximum available marks for the algortihm's efficacy.

The stacks can be rotated, have their top two elements swapped, or be pushed onto each other, the full command list is as follows:

Learnings

the stacks are created as double linked list, so I had to develop a strong grasp of list manipulation to managed both the sorting stacks, and also the linked-list stacks I used to mark the partitions.

I learnt about complexity and (O)n notation.