-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_sort_int_tab.c
33 lines (30 loc) · 1.13 KB
/
ft_sort_int_tab.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sort_int_tab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: malexand <malexand@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/16 23:22:07 by skyzie #+# #+# */
/* Updated: 2017/02/16 17:33:48 by malexand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_sort_int_tab(int *tab, unsigned int size)
{
unsigned int i;
int swap;
i = 0;
while (i < size - 1)
{
if (tab[i] <= tab[i + 1])
i++;
else
{
swap = tab[i];
tab[i] = tab[i + 1];
tab[i + 1] = swap;
i = 0;
}
}
}