tgrekov-push_swap
HIVE push_swap July 2024
|
Definition in file stack.h.
Go to the source code of this file.
Data Structures | |
struct | s_stack |
Functions | |
void | push (t_stack *stack, int mode) |
Push the first element from stack 1 or 2 into the other stack, depending on whether mode is set to 0 or 1. | |
void | r_rot (t_stack *stack, int mode) |
Shift all elements in stack 1, 2, or both up, depending on whether mode is set to 0, 1, or 2. | |
void | rot (t_stack *stack, int mode) |
Shift all elements in stack 1, 2, or both down, depending on whether mode is set to 0, 1, or 2. | |
void | swap (t_stack *stack, int mode) |
Swap the first two elements in stacks 1, 2, or both, depending on whether mode is set to 0, 1, or 2. | |
int | is_sorted (t_stack *stack, int mode) |
Check if the contents of a stack are in the correct order relative to the smallest element. | |
int is_sorted | ( | t_stack * | stack, |
int | mode | ||
) |
Check if the contents of a stack are in the correct order relative to the smallest element.
[in] | stack | |
[in] | mode |
int |
Definition at line 31 of file is_sorted.c.
References get_minix().
void push | ( | t_stack * | stack, |
int | mode | ||
) |
Push the first element from stack 1 or 2 into the other stack, depending on whether mode
is set to 0 or 1.
[in,out] | stack | |
[in] | mode |
Definition at line 55 of file push.c.
References _push(), and ft_printf().
void r_rot | ( | t_stack * | stack, |
int | mode | ||
) |
Shift all elements in stack 1, 2, or both up, depending on whether mode
is set to 0, 1, or 2.
[in,out] | stack | |
[in] | mode |
Definition at line 51 of file r_rot.c.
References _r_rot(), and ft_printf().
void rot | ( | t_stack * | stack, |
int | mode | ||
) |
Shift all elements in stack 1, 2, or both down, depending on whether mode
is set to 0, 1, or 2.
[in,out] | stack | |
[in] | mode |
Definition at line 51 of file rot.c.
References _rot(), and ft_printf().
void swap | ( | t_stack * | stack, |
int | mode | ||
) |
Swap the first two elements in stacks 1, 2, or both, depending on whether mode
is set to 0, 1, or 2.
[in,out] | stack | |
[in] | mode |
Definition at line 48 of file swap.c.
References _swap(), and ft_printf().