projects
/
parallel_computing.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ace460c
)
quicksort.c: Don't sort the portion of the list that matches the pivot.
author
W. Trevor King
<wking@drexel.edu>
Mon, 25 Oct 2010 16:54:21 +0000
(12:54 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Mon, 25 Oct 2010 16:54:21 +0000
(12:54 -0400)
src/sorting/quicksort.c
patch
|
blob
|
history
diff --git
a/src/sorting/quicksort.c
b/src/sorting/quicksort.c
index d763335d14e4eae72d6deb1ffc1329f1d1fbed6a..e66453f14278c3f87590448485a2d3f5d86c1331 100644
(file)
--- 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);
}
}