Explain simple algorithm for bubble sort?

Submitted by: Administrator
void bubble(int x[],int n)
{
int hold,j,pass;
int switched=true;
for(pass=0;pass<n-1&&switched=true;pass++){
switched=false;
for(j=0;j<n-pass-1;j++)
if(x[j]>x[j+1]){
switched=true;
hold=x[j];
x[j]=x[j+1];
x[j+1]=hold;
}
}
}
Submitted by: Administrator

Read Online OS Data Structures Job Interview Questions And Answers