From 8a27889d505b07d91ecd03ad1cfeb818b9b440f7 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Wed, 29 Oct 2014 20:32:33 -0500 Subject: Add instrumentation Track the number of comparisons, swaps, and rotations performed in each part of the sorting algorithm. --- rotate.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rotate.c') diff --git a/rotate.c b/rotate.c index 5eb7696..1815812 100644 --- a/rotate.c +++ b/rotate.c @@ -1,11 +1,14 @@ #include #include "common.h" +#include "counts.h" /* rotates left */ void rotate(char *base, size_t size, size_t shift) { int dir = 1; + + counts[CURRENT].rotate++; while (shift) { while (2*shift <= size) { swap(base, base + dir*shift, shift); -- cgit v1.2.3