Explain simple algorithm for bubble sort?
Submitted by: Administratorvoid 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
{
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
Top OS Data Structures Questions
☺ | Explain real world example of polymorphism and encapsulation? |
☺ | What is AVL tree? |
☺ | Why enum can not be used directly with printf function? |
☺ | What is a complexity of linear search, binery search? |
☺ | What is difference between the run time polymorphism and compile time poly morphism and about virtual function? |
Top Operating System (OS) Categories
☺ | RTOS Interview Questions. |
☺ | Windows 7 Interview Questions. |
☺ | MAC Operating System Interview Questions. |
☺ | Disk Operating System (DOS) Interview Questions. |
☺ | Shell Scripting Interview Questions. |