radix sort pog

This commit is contained in:
2026-05-06 05:46:50 -05:00
parent c1efc67106
commit 9b56a240d1
7 changed files with 143 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
#ifndef LSORT_H
#define LSORT_H
#include "types.h"
int check_sorted(lsort_array_i* array);
#endif

8
include/radix.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef LSORT_RADIX_H
#define LSORT_RADIX_H
#include "types.h"
int lsort_radix(lsort_array_i* array, lsort_array_i* return_array);
#endif

View File

@@ -15,20 +15,24 @@ typedef struct {
int* items;
} lsort_array_i;
lsort_array_i* lsort_create_int_array();
lsort_array_i* lsort_array_i_create();
void lsort_array_i_destroy(lsort_array_i* array);
void lsort_array_i_append(lsort_array_i* array, int number);
int lsort_array_i_swap(lsort_array_i* array, int indexA, int indexB);
void lsort_array_i_print(lsort_array_i* array);
typedef struct {
size_t count;
size_t capacity;
lsort_array_i** items;
} lsort_array_i_array;
// struct lsort_int_link {
// int value;
// lsort_array_i* next;
// };
void lsort_array_i_array_append(lsort_array_i_array* array, lsort_array_i* item);
void lsort_array_i_array_destroy(lsort_array_i_array* array);
#endif