-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_sort_bonus.c
28 lines (24 loc) · 1.08 KB
/
check_sort_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* check_sort_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sanglee2 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/05 21:33:03 by sanglee2 #+# #+# */
/* Updated: 2023/05/27 23:01:39 by sanglee2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap_bonus.h"
int check_sort(t_deq *deq)
{
t_node *temp;
temp = deq->a_top;
while(temp->next)
{
if (temp->index > temp->next->index)
return (0);
temp = temp->next;
}
return (1);
}