public static void main(String[] args) {
// TODO Auto-generated method stub
int[] a = { 10, 20, 50, 30, 20, 40, 70 };
bubblesort(a, 0,a.length-1);
for(int i =0;i<a.length;i++) {
System.out.println(a);
}
}
public static void bubblesort(int a[],int n, int l) {
if(l==0) {
return;
}
if(n==l) {
bubblesort(a,0,l-1);
return;
}
if(a[n]>a[n+1]) {
int temp = a[n];
a[n] = a[n+1];
a[n+1]=temp;
}
bubblesort(a,n+1,l);
}
}