diff --git a/bubbleSort.cpp b/bubbleSort.cpp new file mode 100644 index 0000000..659b714 --- /dev/null +++ b/bubbleSort.cpp @@ -0,0 +1,34 @@ +#include +#include +using namespace std; + +void bubbleSort(vector &a) { + int n = a.size(); + + for(int i=0; i a[j]) { + swap(a[i], a[j]); + } + } + } + +} + +int main() { + + int n; + cin >> n; + + vector a(n); + for(int i=0; i> a[i]; + } + + bubbleSort(a); + + for(int i=0; i