Files
lsort/lsort.c

12 lines
273 B
C
Raw Normal View History

2026-05-04 18:18:55 -05:00
#include "./include/lsort.h"
int check_sorted(lsort_array* array) {
2026-05-06 05:46:50 -05:00
if (array->count <= 0) return 2;
for (int i = 0; i < array->count - 1; i++) {
if (array->items[i]->key > array->items[i + 1]->key) {
2026-05-06 05:46:50 -05:00
return 1;
};
}
return 0;
2026-05-04 18:18:55 -05:00
}