-
Notifications
You must be signed in to change notification settings - Fork 0
/
push_swap.h
71 lines (67 loc) · 2.84 KB
/
push_swap.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alouzizi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/14 15:29:00 by alouzizi #+# #+# */
/* Updated: 2022/03/17 21:18:23 by alouzizi ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <stdlib.h>
# include <unistd.h>
# include <stdio.h>
# include <string.h>
# include "libft/libft.h"
# include "get_next_line/get_next_line.h"
# define INT_MIN -2147483648
# define INT_MAX 2147483647
typedef struct node{
int data;
struct node *next;
}t_node;
int check_args(char *s);
void swap(t_node **head, char c);
void rotate(t_node **head, char c);
void reverse_rotate(t_node **head, char c);
void push(t_node **head, int data);
int check1(char **s);
int check2(char **s);
int ckeck_args(char **s, char *str);
void top_totop(t_node **top, t_node **stack, char c);
void double_rules(t_node **stack_a, t_node **stack_b, int s);
void sort3(t_node **top);
void sort2(t_node **top);
void sort5(t_node **stack_a, t_node **stack_b);
void sort_all(t_node **stack_a, t_node **stack_b);
int index_min(t_node **stack);
void min_push(t_node **stack_a, t_node **stack_b);
int index_max(t_node **stack);
int lent(t_node **head);
int position(int data, t_node **stack_a);
int map(t_node **stack, int index, char str);
void smart_push(t_node **a, t_node **b, int index, char c);
int the_big(int *s, int l);
int the_min(int *s, int l);
int *long_subscoince(int *arr, int n, int *l);
int check_data(int data, int *s, int l);
int *a9al_moves(t_node **a, t_node **b, int ia, int ib);
int to_top(t_node **stack, int index);
void start_sorting(t_node **a, t_node **b);
int min_index(int *s, int l);
int get_data_by_index(int index, t_node **stack);
void real_sorting(t_node **a, t_node **b, int best, int index);
int min(t_node **stack);
int max(t_node **stack);
void sort(t_node **a, t_node **b, int i);
int max_index(int *s, int l);
void get_subscoinc_data(int *index, int l, int *s, int **data);
int *list_to_tab(t_node **list);
void min_instructions(t_node **a, t_node **b, int d, int data);
void join_arg(int ac, char **av, char **str2);
void long_subscoince_2(int *arr, int n, int **prev, int **lis);
int is_sorted(t_node **stack_a);
#endif