Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bubblesort.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
template <class T>
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;
}
}
}
}
3 changes: 2 additions & 1 deletion test-executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand All @@ -71,6 +71,7 @@ int main(int argc, const char* argv[]) {
doTests(sortname);

cleanUp();
delay(100);

return 0;
}