From: W. Trevor King Date: Mon, 25 Oct 2010 16:54:21 +0000 (-0400) Subject: quicksort.c: Don't sort the portion of the list that matches the pivot. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ebbd9d49a9741639f255e885bf56f637c28eeda7;p=parallel_computing.git quicksort.c: Don't sort the portion of the list that matches the pivot. --- diff --git a/src/sorting/quicksort.c b/src/sorting/quicksort.c index d763335..e66453f 100644 --- a/src/sorting/quicksort.c +++ b/src/sorting/quicksort.c @@ -45,9 +45,9 @@ void quicksort(double list[], int m, int n) // put the pivot back in swap(&list[m], &list[j]); - // recursively sort the lesser lists + // recursively sort the sub-lists quicksort(list, m, j - 1); - quicksort(list, j + 1, n); + quicksort(list, i + 1, n); } }