From 9e8caf1e06ba7510160305da11a30d91dcfc23e5 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 6 Sep 2024 21:10:21 +0200 Subject: reformat source code --- src/quicksort.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/quicksort.c') diff --git a/src/quicksort.c b/src/quicksort.c index 4657dcd..0b20ab9 100644 --- a/src/quicksort.c +++ b/src/quicksort.c @@ -3,8 +3,6 @@ #include #include -#include "util.h" - static int bigrand(void) { @@ -124,7 +122,7 @@ quickSort(int arr[], int low, int high) { while ( low < high ) { /* pi is partitioning index, arr[p] is now - at right place */ + at right place */ int pi = partition(arr, low, high); if ( pi - low < high - pi ) { @@ -299,6 +297,7 @@ heapsort_bu(T *data, int n) // zu sortierendes Feld und seine Länge data[child] = val; // versickerten Wert eintragen } + printf("%d\n", count); } /*----------------------------------------------------------------------*/ @@ -356,7 +355,7 @@ bottom_up_heapsort(T r[], int n) { int k; T x; - T * v; + T *v; v = r - 1; /* The address shift */ @@ -606,7 +605,7 @@ test_sorting(T a[], int n) void do_one_test(int n, void (*do_sort)(T a[], int n), void (*gen_testset)(T a[], int n)) { - T * a; + T *a; clock_t start, ende; a = malloc(sizeof(T) * (size_t) n); @@ -649,10 +648,10 @@ main(void) do_all_tests("heapsort_bu", n, heapsort_bu); do_all_tests("bottom_up_heapsort", n, bottom_up_heapsort); do_all_tests("c_quicksort", n, c_quicksort); - //do_all_tests("g4g_quicksort", n, g4g_quicksort); - //do_all_tests("sed_quicksort", n, sed_quicksort); + // do_all_tests("g4g_quicksort", n, g4g_quicksort); + // do_all_tests("sed_quicksort", n, sed_quicksort); do_all_tests("my_introsort", n, my_introsort); - //do_all_tests("my_quicksort", n, my_quicksort); + // do_all_tests("my_quicksort", n, my_quicksort); do_all_tests("pp_quicksort", n, pp_quicksort); do_all_tests("pp_quicksort_it", n, pp_quicksort_it); -- cgit v1.3