minor rearangements
This commit is contained in:
parent
5f6bdaec71
commit
ef03d90fec
@ -21,34 +21,36 @@ typedef struct s_state
|
|||||||
t_list *b;
|
t_list *b;
|
||||||
} t_state;
|
} t_state;
|
||||||
|
|
||||||
t_state *initialise_state(t_state **state);
|
int *longest_incremental_subsequence(t_list *stack, int *lis_size);
|
||||||
int *lis_lengths(t_list *stack, int size);
|
int *lis_lengths(t_list *stack, int size);
|
||||||
int *lis_indices(int *lengths, int size, int max_len);
|
int *lis_indices(int *lengths, int size, int max_len);
|
||||||
|
|
||||||
void b_merge_a(int idx_b, t_state *state);
|
void b_merge_a(int idx_b, t_state *state);
|
||||||
int best_merge_a(t_state *state);
|
int best_merge_a(t_state *state);
|
||||||
int count_moves_merge_a(int idx_b, t_state *state);
|
int count_moves_merge_a(int idx_b, t_state *state);
|
||||||
int error(t_state *state);
|
|
||||||
void free_state(t_state *state);
|
|
||||||
int is_sorted(t_list *stack);
|
|
||||||
int has_duplicates(t_list *stack);
|
|
||||||
int *longest_incremental_subsequence(t_list *stack, int *lis_size);
|
|
||||||
void push_all_but_lis(t_state *state);
|
|
||||||
t_list *ft_lstat(t_list *list, int n);
|
|
||||||
int ft_abs(int a);
|
|
||||||
int ft_max(int a, int b);
|
|
||||||
|
|
||||||
int stack_min(t_list *lst);
|
|
||||||
void print_stack(const char *name, t_list *stack);
|
|
||||||
void print_state(t_state *state);
|
|
||||||
|
|
||||||
void sortmore(t_state *state);
|
void sortmore(t_state *state);
|
||||||
int sort3(t_state *state);
|
int sort3(t_state *state);
|
||||||
|
|
||||||
|
int error(t_state *state);
|
||||||
|
t_state *initialise_state(t_state **state);
|
||||||
|
void free_state(t_state *state);
|
||||||
|
|
||||||
|
int has_duplicates(t_list *stack);
|
||||||
|
int is_sorted(t_list *stack);
|
||||||
|
int ft_max(int a, int b);
|
||||||
|
int ft_abs(int a);
|
||||||
|
int stack_min(t_list *lst);
|
||||||
|
|
||||||
|
void print_stack(const char *name, t_list *stack);
|
||||||
|
void print_state(t_state *state);
|
||||||
|
|
||||||
|
t_list *ft_lstat(t_list *list, int n);
|
||||||
int count_gt(int n, t_list *stack);
|
int count_gt(int n, t_list *stack);
|
||||||
int index_of(int number, t_list *stack);
|
int index_of(int number, t_list *stack);
|
||||||
int new_element(t_list **stack, const char *str);
|
int new_element(t_list **stack, const char *str);
|
||||||
|
|
||||||
int put_at_index_asc(int number, t_list *stack);
|
int put_at_index_asc(int number, t_list *stack);
|
||||||
|
void push_all_but_lis(t_state *state);
|
||||||
void push_all_but_3_b(t_state *state);
|
void push_all_but_3_b(t_state *state);
|
||||||
void push(t_list **stack_1, t_list **stack_2);
|
void push(t_list **stack_1, t_list **stack_2);
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "push_swap.h"
|
#include "push_swap.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
void push_all_but_lis(t_state *state)
|
void push_all_but_lis(t_state *state)
|
||||||
{
|
{
|
||||||
@ -34,4 +35,5 @@ void push_all_but_lis(t_state *state)
|
|||||||
pb(state);
|
pb(state);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
free(lis_indices);
|
||||||
}
|
}
|
||||||
|
|||||||
24
tester.sh
24
tester.sh
@ -49,28 +49,6 @@ run_test_case() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_test_case 1 10
|
run_test_case 500 1000
|
||||||
run_test_case 2 10
|
|
||||||
run_test_case 3 10
|
|
||||||
run_test_case 4 10
|
|
||||||
run_test_case 5 10
|
|
||||||
run_test_case 6 10
|
|
||||||
run_test_case 7 10
|
|
||||||
run_test_case 8 10
|
|
||||||
run_test_case 9 10
|
|
||||||
run_test_case 10 10
|
|
||||||
run_test_case 20 10
|
|
||||||
run_test_case 30 10
|
|
||||||
run_test_case 40 10
|
|
||||||
run_test_case 50 10
|
|
||||||
run_test_case 60 10
|
|
||||||
run_test_case 70 10
|
|
||||||
run_test_case 80 10
|
|
||||||
run_test_case 90 10
|
|
||||||
run_test_case 100 10
|
|
||||||
run_test_case 200 10
|
|
||||||
run_test_case 300 10
|
|
||||||
run_test_case 400 10
|
|
||||||
run_test_case 500 10
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user