diff --git a/bubblesort.hpp b/bubblesort.hpp index 9eaef72..36a1a04 100644 --- a/bubblesort.hpp +++ b/bubblesort.hpp @@ -1,10 +1,15 @@ template -void bubblesort(T a[], size_t size) { - for (size_t i = size; i > 0; i--) +void bubblesort(T a[], int size) { + for (int i = o; i < size; i++) + { for (size_t j = 0; j < i-1; j++) - if (a[j] > a[j+1]) { + { + if (a[j] > a[j+1]) + { T t = a[j]; a[j] = a[j+1]; a[j+1]=t; } + } + } } diff --git a/test-executor.cpp b/test-executor.cpp index bd2f346..0597237 100644 --- a/test-executor.cpp +++ b/test-executor.cpp @@ -53,7 +53,7 @@ void doTests(std::string sortname) { void cleanUp() { for (int i = MIN_POWER; i <= MAX_POWER; i++) { - for (int j = 0; j < TRIES; j++) { + for (int j = 0; j <= TRIES; j++) { delete[] dt[i][j]; } } @@ -71,6 +71,7 @@ int main(int argc, const char* argv[]) { doTests(sortname); cleanUp(); + delay(100); return 0; }