-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimised_push_a.c
25 lines (22 loc) · 1.11 KB
/
optimised_push_a.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* optimised_push_a.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zhlim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/08 16:04:21 by zhlim #+# #+# */
/* Updated: 2023/08/10 17:09:47 by zhlim ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void optimised_push_a(t_list **stack_a, t_list **stack_b)
{
t_op op;
while (ft_lstsize(*stack_b))
{
init_op(&op);
calculate_cost_a(*stack_a, *stack_b, &op);
to_push(stack_a, stack_b, op.to_push, 'a');
}
}