-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_swap.h
59 lines (45 loc) · 1.25 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
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include "libft/libft.h"
typedef struct s_stack {
int nbr;
int i;
struct s_stack *p;
} t_stack;
// Main Functions
int main(int argc, char **argv);
int ft_error(int argc, char ***argv);
void stack_init(t_stack **a, int argc, char **argv);
void sort_a(t_stack **a, t_stack **b);
// Stack Utils
int stacklen(t_stack *lst);
int already_sorted(t_stack **stack);
int checkemptystack(t_stack **stack);
void new_last_node(t_stack **stack, t_stack *new_node);
void clean_stack(t_stack **stack);
t_stack *last_node(t_stack *stack);
// Sorting Functions
void three_values(t_stack **a);
void four_values(t_stack **a, t_stack **b);
void five_values(t_stack **a, t_stack **b);
void radix(t_stack **a, t_stack **b);
// Swap
void swap(t_stack **stack);
void sa(t_stack **a);
void sb(t_stack **b);
void ss(t_stack **a, t_stack **b);
// Push
void push(t_stack **stack_src, t_stack **stack_dest);
void pa(t_stack **a, t_stack **b);
void pb(t_stack **b, t_stack **a);
// Rotate
void rotate(t_stack **stack);
void ra(t_stack **a);
void rb(t_stack **b);
void rr(t_stack **a, t_stack **b);
// Reverse Rotate
void reverse_rotate(t_stack **stack);
void rra(t_stack **a);
void rrb(t_stack **b);
void rrr(t_stack **a, t_stack **b);
#endif