Add BubbleSort
This commit is contained in:
@@ -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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user