Answer Posted / 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 |
Post New Answer View All Answers
How do you empty an arraylist?
What is stable sorting method?
What are the properties of an algorithm?
What is the best case for bubble sort?
List the two important key points of depth first search?
Define an equivalence relation?
What is the time complexity of hashmap get () and put () method?
What is the method to find the complexity of an algorithm?
Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92 24 6 7 11 8 22 4 5 16 19 20 78
What are the types of sorting?
What are linear and non linear data structures?
What is the most used data structure?
What is the difference between ienumerable and list?
What are three common types of traversals?
where do you use double linked list?