tgrekov-push_swap
HIVE push_swap July 2024
Loading...
Searching...
No Matches
stack.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* stack.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/07/06 04:03:43 by tgrekov #+# #+# */
9/* Updated: 2024/07/16 12:25:05 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
20#ifndef STACK_H
21# define STACK_H
22
23typedef struct s_stack
24{
25 int len;
26 int *n;
27} t_stack;
28
29void push(t_stack *stack, int mode);
30void r_rot(t_stack *stack, int mode);
31void rot(t_stack *stack, int mode);
32void swap(t_stack *stack, int mode);
33
34int is_sorted(t_stack *stack, int mode);
35
36#endif
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 ...
Definition push.c:55
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,...
Definition r_rot.c:51
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,...
Definition rot.c:51
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,...
Definition swap.c:48
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.
Definition is_sorted.c:31