void bubbleSort1(int []a, int n)
{
int i,j,exchange;
int temp;
for(i=1;i<n;i++)
{
exchange=0;
for(j=0;j<n-i;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
exchange=1;
}
}
if(exchange==0)
return ;
}
for(int value:a)
System.out.println(value);
}