From ebbd9d49a9741639f255e885bf56f637c28eeda7 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 25 Oct 2010 12:54:21 -0400 Subject: [PATCH] quicksort.c: Don't sort the portion of the list that matches the pivot. --- src/sorting/quicksort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } -- 2.26.2