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
Define the graph data structure?
What is the difference between linked list and array?
What stack means?
what is Linked lists?
How many sorting are there in data structure?
Why is the isempty() member method called?
How do you sort an arraylist?
Can we create a null as a key for a map collection?
What are the parts of a linked list?
What's the difference between an array and vector?
How does a hashtable work?
Define indegree of a graph?
Does arraylist have index?
What are trees in data structures?
Tell me what is quick sort?