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 |
Is quicksort greedy algorithm?
When is a binary search best applied?
Is hashmap faster than arraylist?
Can you make an arraylist of arrays?
What is difference between array and arraylist? When will you use array over arraylist?
Is array faster than arraylist?
Explain implementation of deletion from a binary tree.
What happens in insertion sort?
Is it necessary to sort a file before searching a particular item ?
Is a list an array?
What is the difference between classifying and sorting?
What is meant by int?