-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_checks.c
27 lines (24 loc) · 1.05 KB
/
ft_checks.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* checks.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: flfische <[email protected]. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/29 13:33:04 by flfische #+# #+# */
/* Updated: 2024/03/29 13:33:31 by flfische ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_push_swap.h"
int ft_is_sorted(int *stack, int len)
{
int i;
i = 0;
while (i < len - 1)
{
if (stack[i] > stack[i + 1])
return (0);
i++;
}
return (1);
}