-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlarge_sorting.c
34 lines (32 loc) · 1.33 KB
/
large_sorting.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* large_sorting.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yst-laur <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/09 14:18:53 by yst-laur #+# #+# */
/* Updated: 2022/03/09 14:18:57 by yst-laur ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void large_sorting(char **binstack_a, char **binstack_b, int bit)
{
int counter;
int stop;
counter = 0;
stop = strstack_size(binstack_a);
while (bit > 0)
{
while (binstack_a[0][bit - 1] == '0')
{
pbbin(binstack_a, binstack_b);
if (++counter == stop)
stackrewind(binstack_a, binstack_b, &counter, &bit);
}
if (bit > 0)
rabin(binstack_a);
if (++counter == stop)
stackrewind(binstack_a, binstack_b, &counter, &bit);
}
}