eleotard / push_swap_42

The program must sort a list of integers through specific sorting rules. The goal is to make as few moves as possible to sort the numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

push_swap_42

eleotard's 42 push_swap Score

image

This program was created by combining two forms of sorting. I first retrieved the longest increasing subsequence and then applied a median sort. A smart move algorithm then reduces the number of total moves by calculating which moves are the most optimal.

Usage

./push_swap (numbers to sort) | ./checker_linux (numbers to sort)

Example

100 random numbers were sorted in 554 moves :

image

500 random numbers were sorted in 4832 moves :

image

About

The program must sort a list of integers through specific sorting rules. The goal is to make as few moves as possible to sort the numbers


Languages

Language:C 95.7%Language:Makefile 4.3%