-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_sort_selector.c
32 lines (30 loc) · 1.25 KB
/
ft_sort_selector.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
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sort_selector.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marias-e <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 11:56:02 by marias-e #+# #+# */
/* Updated: 2023/01/11 12:30:16 by marias-e ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
/*
* Selects the sorting method according to the list size.
*
* Parameters:
* size - number of nodes of the list
* stack_a - list of numbers
*/
void ft_sort_selector(int size, t_list **stack_a)
{
if (size == 2)
ft_sort_2(stack_a);
else if (size == 3)
ft_sort_3(stack_a);
else if (size == 4)
ft_sort_4(stack_a);
else
ft_big_sort(stack_a, size);
}