From 986fb0a99d80c0eafd579d84bcf268ea17db9090 Mon Sep 17 00:00:00 2001 From: Arjun Luam Date: Sat, 13 Oct 2018 19:37:48 +0530 Subject: [PATCH] algo for bubble sort --- Bubble Sort.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Bubble Sort.cpp diff --git a/Bubble Sort.cpp b/Bubble Sort.cpp new file mode 100644 index 0000000..01f0e38 --- /dev/null +++ b/Bubble Sort.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; +int main(){ + int a[20]; + int n,x,v; + cin>>n; + for(int i=0;i>x; + a[i]=x; +} +for(int u=n-1;u>0;u--){ + for(int j=0;j