From ebb2a0279c3a10165d7140a4a67870e59a2f6f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 28 Apr 2015 15:24:28 +0200 Subject: [PATCH] bucketsort: add comments --- c_sequential/bucketsort/bucketsort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/c_sequential/bucketsort/bucketsort.c b/c_sequential/bucketsort/bucketsort.c index 888ffb2..22b4041 100644 --- a/c_sequential/bucketsort/bucketsort.c +++ b/c_sequential/bucketsort/bucketsort.c @@ -2,6 +2,8 @@ #include #include "bucketsort.h" +// Printable characters in Ascii (from 34 to 127); +// actually 127 is also not printable #define N_BUCKETS 94 typedef struct { @@ -42,6 +44,7 @@ long int* bucket_sort(char *a, int length, long int size) { // copy the keys to "buckets" for (i = 0; i < size; i++) { + // 0x21 = 33d, number of unprintable characters in Ascii b = &buckets[*(a + i * length) - 0x21]; b->data[b->total++] = i; }