Whether you’re familiar with sorting algorithms or just stepping into the world of data manipulation, the Push_swap project offers a fascinating journey into the realm of algorithmic optimization. This project challenges you to sort data on a stack using a limited set of instructions while aiming to minimize the number of actions required. Get ready to delve deep into the world of sorting algorithms and discover the beauty of efficiency.
Push_swap is a project designed to test your ability to sort data efficiently. You’ll be given a stack of integers and a set of instructions to manipulate the stack. Your task is to write a program that generates the smallest sequence of instructions needed to sort the integers in ascending order. It may sound simple, but the devil is in the details.
Sorting algorithms are fundamental to programming and are often a topic of discussion in job interviews. By completing this project, you’ll gain a deeper understanding of algorithm complexity and learn how to choose the most efficient sorting solution for different scenarios. This project emphasizes rigor, C programming skills, and algorithmic complexity.
- Your project must be implemented in C.
- Adherence to the Norm is essential. Ensure your code meets the specified guidelines, including error handling and memory management.
- Provide a Makefile for compiling your source files with appropriate flags.
- Submission should include all necessary files, including header files, source files, and any additional resources.
- Encouraged to create test programs to ensure the correctness and robustness of your implementation.
push_swap
Makefile
, *.h
, *.c
NAME
,all
,clean
,fclean
,re
A list of integers representing the initial stack configuration.
read
,write
,malloc
,free
,exit
ft_printf
or equivalent
Yes
Create a program that generates the smallest sequence of instructions to sort a stack of integers in ascending order.
- You have two stacks named
a
andb
. - Stack
a
contains a random amount of integers, with no duplicates. - Stack
b
is initially empty. - Use provided instructions to manipulate the stacks and sort the integers in stack
a
. - The goal is to sort the integers in stack
a
with the fewest number of operations possible.
While the focus of this project is on the mandatory requirements, you can implement additional features to enhance your project. However, the bonus part will only be assessed if the mandatory part is perfect.
Submit your completed assignment to your assigned Git repository following the provided instructions. Only the work within the Git repository will be evaluated during the defense. Ensure all files are correctly named and organized before submission.