#include
using namespace std;
void bubblesort(int a[], int j, int n){
if(n==0) return;
if(j==n-1) return bubblesort(a,0,n-1);
if(a[j]>a[j+1]) swap(a[j],a[j+1]);
bubblesort(a,j+1,n);
return; // If we do not write this return statement the code still runs so what is the purpose of this return??
}
int main() {
int a[]={5,4,3,1}, n=4;
bubblesort(a,0,n);
for(int i=0;i<n;i++) cout<<a[i]<<" ";
return 0;
}