Unfortunately the performance is not good right now,
but this should be rather easy to fix.
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/13 15:04:19 by dkaiser #+# #+# */
-/* Updated: 2024/04/17 14:17:55 by dkaiser ### ########.fr */
+/* Updated: 2024/04/17 15:48:53 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#include "libft/ft_printf.h"
#include "push_swap.h"
static void presort(t_psdata *data)
max = data->a->stack[0];
while (size--)
{
- if (data->a->stack[0] > max)
+ if (data->a->stack[0] < max)
{
run_command(data, PB);
if (data->b->stack[0] < pivot)