From 80c6726f02c2d32d742ced3d0b5442ed4146d7c2 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Fri, 27 Apr 2012 12:53:43 +0200 Subject: [PATCH] Fixed function ordering. --- Base/quicksort.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Base/quicksort.h b/Base/quicksort.h index d2d031c5243..10a83c09899 100644 --- a/Base/quicksort.h +++ b/Base/quicksort.h @@ -14,16 +14,6 @@ // Base #include "swap.h" -template <class T> -void quickSort(T* array, unsigned beg, unsigned end) -{ - if (beg < end) { - unsigned p = partition_(array, beg, end); - quickSort(array, beg, p); - quickSort(array, p+1, end); - } -} - template <class T> unsigned partition_(T* array, unsigned beg, unsigned end) { @@ -43,6 +33,16 @@ unsigned partition_(T* array, unsigned beg, unsigned end) return j; } +template <class T> +void quickSort(T* array, unsigned beg, unsigned end) +{ + if (beg < end) { + unsigned p = partition_(array, beg, end); + quickSort(array, beg, p); + quickSort(array, p+1, end); + } +} + /** * Permutes the entries of a part of an array such that all entries that are smaller * than a certain value are at the beginning of the array and all entries that are -- GitLab