mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
44 lines
1.9 KiB
C
44 lines
1.9 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* medium_headers.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/01/07 07:47:49 by mteriier #+# #+# */
|
|
/* Updated: 2026/01/07 07:47:51 by mteriier ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef MEDIUM_HEADERS_H
|
|
# define MEDIUM_HEADERS_H
|
|
|
|
typedef struct s_tab
|
|
{
|
|
int max_range;
|
|
int nb_in;
|
|
struct s_tab *next;
|
|
} t_tab;
|
|
|
|
/* MEDIUM ALGO FILE */
|
|
int wich_path(t_stacks *stacks, int max_range, int range, char c);
|
|
int stack_len(t_stack *stack);
|
|
void bucket_algo(t_stacks *stacks, t_tab *preset, int range);
|
|
/* SORT UTILS FILES */
|
|
void sort_from_left(t_stacks *stacks);
|
|
void sort_from_right(t_stacks *stacks);
|
|
void push_range_to_b(t_stacks *stacks, t_tab *one_preset, int range);
|
|
void normal_move_path(t_stacks *stacks, t_tab *one_preset, int range);
|
|
t_stack *assign_stack(t_stacks *stacks, char c);
|
|
/* MEDIUM UTILS FILES */
|
|
int range_bucket(t_stack *first);
|
|
int get_first_lower(t_stack *first);
|
|
int get_next_lower(t_stack *first, int old_lower);
|
|
int calcul_range(int value, int range);
|
|
int in_range(int value, int max_range, int range);
|
|
int get_number_in_range(int max_range, t_stack *a, int range);
|
|
/* UTILS STRUCT TAB FILE */
|
|
t_tab *get_tabs(t_stack *first, int range);
|
|
|
|
#endif
|