Skip to content

push swap, a 42 school project about sorting numbers with 2 stacks

Notifications You must be signed in to change notification settings

biralavor/42_pushswap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6e7d86c · Jul 1, 2024
Jun 28, 2024
Jul 1, 2024
Jul 1, 2024
Jun 26, 2024

Repository files navigation

42_pushswap

WIP - push swap, a 42 school project about ordination algorithm.

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

Screenshot from 2024-05-28 19-43-27

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. Screenshot from 2024-05-28 19-34-53

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. Screenshot from 2024-05-28 19-39-16

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 total moviments to sort them;
  • .
  • .
  • .

this README is still in WIP

Screenshot from 2024-06-26 14-50-12