-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_sortinttab.c
30 lines (27 loc) · 1.09 KB
/
ft_sortinttab.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sortinttab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nvienot <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/21 17:58:04 by nvienot #+# #+# */
/* Updated: 2018/11/21 17:58:32 by nvienot ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_sortinttab(int *tab, unsigned int size)
{
unsigned int i;
i = 0;
while (i < size - 1)
{
if (tab[i] <= tab[i + 1])
i++;
else
{
ft_swap(&tab[i], &tab[i + 1]);
i = 0;
}
}
}