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
Which interfaces are implemented by linkedlist?
Is bucket sort stable?
Why do we need linked list?
What is homogeneous array?
Why might quick sort might be better than merge sort?
What is collection process?
Which is the parent class of printerstatereasons class?
State the demerit of linear representation of binary trees?
Explain what do you mean by insertion sort, bubble sort and selection sort? Also, explain the differences among the functionalities of the three sorts.
What is frozenset?
List the data structures which are used in hierarchical data model.
Different Types of pattern?
Is hashmap a collection?
What are the types of bulleted list?
What is the purpose of sorting algorithms?