mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
24 lines
1.0 KiB
C
24 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* bubble.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/12/09 11:56:23 by mteriier #+# #+# */
|
|
/* Updated: 2025/12/09 13:19:39 by dgaillet ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "push_swap.h"
|
|
|
|
void bubble_alg(t_stacks *stacks)
|
|
{
|
|
while (!check_order(stacks->a))
|
|
{
|
|
if (stacks->a->value > stacks->a->next->value)
|
|
sa(stacks);
|
|
ra(stacks);
|
|
}
|
|
}
|