Add BubbleSort

This commit is contained in:
Samuel Oberhofer 2022-05-23 21:16:37 +02:00
parent 935c4a6a53
commit 7b47854cb9
1 changed files with 11 additions and 0 deletions

11
Uebung 1/Algorithms.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
#include "Sortiment.h"
#include <algorithm>
void bubbleSort(Ware *waren[10]) {
for (int i = 0; i < 10; i++) {
if (waren[i] > waren[i + 1]) {
std::swap(waren[i], waren[i + 1]);
}
}
}