insertion sort note optimized is working

This commit is contained in:
David Gailleton
2025-12-14 16:51:11 +01:00
parent a68bcd2503
commit 0d01b58ff1
3 changed files with 60 additions and 9 deletions

8
main.c
View File

@@ -6,7 +6,7 @@
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 18:32:35 by mteriier #+# #+# */
/* Updated: 2025/12/11 18:32:06 by dgaillet ### ########lyon.fr */
/* Updated: 2025/12/12 14:06:41 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
@@ -66,9 +66,9 @@ int main(int argc, char **argv)
print_all_stack(stacks->a, stacks->a, 'A');
print_all_stack(stacks->b, stacks->b, 'B');
*/
print_stacks(stacks, highest_stack_len(stacks), stacks->a, stacks->b);
insertion(stacks, stack_a_len(stacks), 0);
print_stacks(stacks, highest_stack_len(stacks), stacks->a, stacks->b);
//print_stacks(stacks, highest_stack_len(stacks), stacks->a, stacks->b);
insertion(stacks, 0, stack_a_len(stacks));
//print_stacks(stacks, highest_stack_len(stacks), stacks->a, stacks->b);
}
stack_clear_all(stacks->a, stacks->a);
stack_clear_all(stacks->b, stacks->b);