Better memory management of arrays and test sample generation

This commit is contained in:
2026-05-15 13:18:01 -05:00
parent de5493e7c6
commit f186ebfca8
12 changed files with 228 additions and 177 deletions

15
test/samples.c Normal file
View File

@@ -0,0 +1,15 @@
#include "../include/types.h"
#include "include/samples.h"
#include <stdlib.h>
#include <time.h>
lsort_array* generate_samples(int number) {
srand(time(NULL));
lsort_array* array = lsort_array_create();
for (int i = 0; i < number; i++) {
lsort_array_append(array, lsort_item_create(rand(), NULL));
}
return array;
};