simple algorithm for bubble sort?
Answer / siri
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;
}
}
}
| Is This Answer Correct ? | 4 Yes | 1 No |
What is array in data structure with example?
Which sorting algorithm is used in collections sort?
Define a set?
What are linked lists used for?
How do you declare An array of three pointers to chars
What are the advantages of selecetion sort?
What is difference between rb tree and avl tree?
Explain Queue
Define general trees?
Can you declare an array without assigning the size of an array?
How would you sort words in a large file?
What are the standard ways in which a graph can be traversed?