diff --git a/Data Structures/Swap_count_bs.cpp b/Data Structures/Swap_count_bs.cpp new file mode 100644 index 0000000..3ccbc4e --- /dev/null +++ b/Data Structures/Swap_count_bs.cpp @@ -0,0 +1,54 @@ +#include +using namespace std; + +int bubble_sort_swap(int array[],int size){ + + int swap =0; + for(int i = size-2;i>=0;i--){ + for(int j=0;j<=i;j++){ + + if(array[j] >array[j+1]){ + + swap++; + // cout<<"Swap:"<