From 9674332f03f434534017c0f70f3c213fa4ebb2bf Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Sat, 13 Apr 2024 15:31:29 +0200 Subject: [PATCH] Add radixsort --- Makefile | 2 +- main.c | 17 +++++++---------- sorting.c | 30 ++++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9a704a1..5509c89 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ LIBFT = libft CC = cc CFLAGS = -Wall -Wextra -Werror -SRC_FILES = main.c input_handling.c stack_utils.c command_handling.c +SRC_FILES = main.c input_handling.c stack_utils.c command_handling.c sorting.c OBJ_FILES = $(SRC_FILES:%.c=%.o) LIB_DIR = $(LIBFT) diff --git a/main.c b/main.c index 84cc7ad..1476fb1 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: dkaiser content >> bit) % 2 == 0) + run_command(stack_a, stack_b, cmds, PB); + else + run_command(stack_a, stack_b, cmds, RA); + i++; + } + while (*stack_b) + run_command(stack_a, stack_b, cmds, PA); + bit++; + } +} +void stack_sort(t_list **stack_a, t_list **stack_b, t_list **cmds) +{ + stack_radixsort(stack_a, stack_b, cmds); } -- 2.47.2