summaryrefslogtreecommitdiff
path: root/src/03/sort.c
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-09-20 18:58:13 -0600
committermo khan <mo.khan@gmail.com>2020-09-20 18:58:13 -0600
commita240eea48a043ada394490e23b055238c90ac38a (patch)
tree8669ebe7f2d5019a22fcd289ac41b44e098e5cee /src/03/sort.c
parent8678b27edaa7fde2884c2feec831982c820ab703 (diff)
docs: print output of merge/quick sort
Diffstat (limited to 'src/03/sort.c')
-rw-r--r--src/03/sort.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/03/sort.c b/src/03/sort.c
index d67bfff..d46a8d6 100644
--- a/src/03/sort.c
+++ b/src/03/sort.c
@@ -1,6 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
+static void dump(int *items, int n)
+{
+ printf("[");
+ for (int i = 0; i < n; ++i)
+ printf("%d,", items[i]);
+ printf("]\n");
+}
+
static void _merge(int *items, int min, int mid, int max) {
int length = (max-min) + 1;
int tmp[length];