From 9674332f03f434534017c0f70f3c213fa4ebb2bf Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Sat, 13 Apr 2024 15:31:29 +0200 Subject: Add radixsort --- sorting.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'sorting.c') diff --git a/sorting.c b/sorting.c index 3624ae5..135a94d 100644 --- a/sorting.c +++ b/sorting.c @@ -6,13 +6,39 @@ /* 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); } -- cgit v1.2.3