https://github.com/biralavor/42_pushswap
push swap, a 42 school project about sorting numbers with 2 stacks
https://github.com/biralavor/42_pushswap
cunit minunit pushswap-42 sorting-algorithms
Last synced: 4 months ago
JSON representation
push swap, a 42 school project about sorting numbers with 2 stacks
- Host: GitHub
- URL: https://github.com/biralavor/42_pushswap
- Owner: biralavor
- Created: 2024-05-06T16:56:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-29T17:01:44.000Z (about 1 year ago)
- Last Synced: 2025-05-29T18:38:59.594Z (about 1 year ago)
- Topics: cunit, minunit, pushswap-42, sorting-algorithms
- Language: C
- Homepage:
- Size: 43.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 42_pushswap
|  | Push Swap, a 42 school project about ordination algorithm. |  |
| :-: | :-: | :-: |
> [!TIP]
> This project was done with in TDD mode -> Test Driven Development.
> 
>
> If you wanna try my tester, you should type:
>
> ```
> cd _ci_tdd && make
> ```
# Efficiency vs Efficacy
- What's the difference between them?
- Which one is required for the ```push_swap``` project?
## Real Case Study
Let's suppose that you need to commute from your house to your work by car, but here is a traffic jam ahead, like Mr. Goofy from Disney:
https://www.youtube.com/watch?v=_Tlk6e61E6w

## Efficiency - The goal, whatever it takes
You can drive like Mr. Goofy but at crazy mode accelerating a lot, changing lanes every second, hitting brakes... and eventually arriving at work.

### Did you make the goal? **Yes**.
But probably, you burned some really important resources from your car (gas, oil, brakes, engine), and from yourself (mental health, stress, anxiety, etc...)
## Efficacy - The goal, with minimal resources
However, you can also goes like the initial state from Mr. Goofy: a pleasant guy which could find another path or even just wait with pacience and love the innevitable truth: there will be a traffic jam ahead.

### Did you make the goal? **Yes**.
Without burning your brain, tires and fuel unnecessarily.
## Push_Swap - Which one is required?
Push Swap is about a program that **sort numbers** from user's input, but also:
- has 2 stacks to store the given numbers;
- has 11 basic functions to move the numbers between stacks;
- calculates the cost of every number, with a given target
- search for the cheapest moviment
- do the moviments to sort the list
Even with cost calculation, this program works only with **efficiency mode** (the goal, whatever it takes).
The project's algorithm was created by Mia Combeau: https://github.com/mcombeau/push_swap

> If you wanna try my Push_Swap, you should type:
>
> ```
> make
> ```
> All 42 Badges -- the astronomer Human Coder -- were done by Larissa Cristina [@mewmewdevart](https://github.com/mewmewdevart/42Badges)