diff --git a/DataStructures/bubble sort.cpp b/DataStructures/bubble sort.cpp new file mode 100644 index 00000000..bf1ae0a3 --- /dev/null +++ b/DataStructures/bubble sort.cpp @@ -0,0 +1,51 @@ +#include +using namespace std; + +void Bubble_sort(int size,int A[]) //bubble up +{ + for(int i=0; iA[j+1]) + { + int temp=A[j]; + A[j]=A[j+1]; + A[j+1]=temp; + flag=1; + } + + } + if(flag==0) + { break; + + } + + } + + cout<<"\n After sort"; + + for(int i=0; i>size; + int A[10]; + cout<<"Enter the values of aray\n"; + for(int i=0; i>A[i]; + } + Bubble_sort(size,A); + return 0; +}