diff --git a/scratchpad/quickselect/makefile b/scratchpad/quickselect/makefile index c755523..5bc70f0 100644 --- a/scratchpad/quickselect/makefile +++ b/scratchpad/quickselect/makefile @@ -3,3 +3,9 @@ build: run: ./quickselect + +## Formatter +STYLE_BLUEPRINT=webkit +FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) +format: + $(FORMATTER) quickselect.c diff --git a/scratchpad/quickselect/quickselect.c b/scratchpad/quickselect/quickselect.c index 7bdb960..6ddc4c2 100644 --- a/scratchpad/quickselect/quickselect.c +++ b/scratchpad/quickselect/quickselect.c @@ -2,63 +2,68 @@ #include #include -void swp(int i, int j, double xs[]){ - double tmp = xs[i]; - xs[i] = xs[j]; - xs[j] = tmp; +void swp(int i, int j, double xs[]) +{ + double tmp = xs[i]; + xs[i] = xs[j]; + xs[j] = tmp; } -void array_print(double xs[], int n){ - printf("["); - for(int i=0; i