-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_swap.h
More file actions
53 lines (50 loc) · 2.23 KB
/
push_swap.h
File metadata and controls
53 lines (50 loc) · 2.23 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aelmsafe <aelmsafe@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/22 12:34:12 by aelmsafe #+# #+# */
/* Updated: 2025/03/05 04:22:03 by aelmsafe ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <stddef.h>
# include <stdlib.h>
# include <unistd.h>
# include <stdint.h>
# include <stdbool.h>
typedef struct dlist_s
{
struct dlist_s *next;
int data;
int idx;
} t_dlist_t;
t_dlist_t *create_node(int data);
t_dlist_t *create_stack(int ac, char **av);
size_t ft_strlen(const char *s);
size_t ft_strlcpy(char *dst, const char *src, size_t dstsize);
char **ft_split(char const *s, char c);
void free_double_array(char **arr);
void free_struc(t_dlist_t **head);
void free_and_quit(bool b, char **arr, t_dlist_t **stack);
void swap(t_dlist_t **stack, char c);
void push(t_dlist_t **s0, t_dlist_t **s1, char c);
void rotate(t_dlist_t **stack, char c);
void reverse_rotate(t_dlist_t **stack, char c);
void ss(t_dlist_t **a, t_dlist_t **b);
void rr(t_dlist_t **a, t_dlist_t **b);
void rrr(t_dlist_t **a, t_dlist_t **b);
long ft_atol(char *s, bool b, char **arr, t_dlist_t **stack);
void check_if_dups(t_dlist_t **a);
void check_if_sorted(t_dlist_t **a);
int stack_len(t_dlist_t *a);
void index_nodes(t_dlist_t *stack_a);
void append_node(t_dlist_t **head, int data, char **arr);
void sort_three(t_dlist_t **a);
void sort_four_to_five(t_dlist_t **a, t_dlist_t **b);
void my_sorting_algo(t_dlist_t **a, t_dlist_t **b);
void check_rr(t_dlist_t **a, t_dlist_t **b, int *rot, int double_r);
#endif /* PUSH_SWAP_H */