more info for thiersort testing - seems like apply maybe has a bug

This commit is contained in:
Richard Thier 2023-06-30 17:00:37 +02:00
parent 36189e8a3c
commit 9ac3a76209

View File

@ -409,18 +409,26 @@ void thiersort_uintkey8(uint32_t *arr, int n) {
malloc);
for(uint32_t i = 0; i < n; ++i) {
printf("In: %d\n", tarr[i].key.u);
printf("In: %d @%d\n", tarr[i].key.u, tarr[i].i);
}
// Sort: O(n*loglogn on amortized on random input):
/*
thiersort8_uintkey(
tarr,
n,
malloc,
free);
*/
ts_quicksort_inplace(
tarr,
0, // from
n, // to
ts_lt_uint,
nullptr);
for(uint32_t i = 0; i < n; ++i) {
printf("Out: %d\n", tarr[i].key.u);
printf("Out: %d @%d\n", tarr[i].key.u, tarr[i].i);
}
// Apply: O(n)