From b3313ff01a8069592f63b18372fd0cf9e6c077bd Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 10 Jan 2023 16:59:41 +0100 Subject: Some updates on algo/csort.h and example. --- misc/examples/sort.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/examples/sort.c b/misc/examples/sort.c index ace1a6a4..711ba7a6 100644 --- a/misc/examples/sort.c +++ b/misc/examples/sort.c @@ -3,8 +3,8 @@ #include #include -typedef float Elem; -#define fmt_Elem "%g" +typedef long long Elem; +#define fmt_Elem "%lld" #ifdef __cplusplus #include #else @@ -50,5 +50,12 @@ int main(int argc, char *argv[]) { for (i = 0; i < size; i++) a[i] = 126735; testsort(a, size, "constant"); + for (i = 0; i < size; i++) a[i] = i + 1; + a[size - 1] = 0; + testsort(a, size, "rotated"); + + for (i = 0; i < size; i++) a[i] = i % (size / 2); + testsort(a, size, "repeated"); + free(a); } -- cgit v1.2.3