12 lines
273 B
C
12 lines
273 B
C
#include "./include/lsort.h"
|
|
|
|
int check_sorted(lsort_array* array) {
|
|
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) {
|
|
return 1;
|
|
};
|
|
}
|
|
|
|
return 0;
|
|
} |