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 do you mean by probing?
What's the difference between an array and vector?
Define path in a graph?
Define adjacent nodes?
What is arraylist load factor?
Define b-tree of order m?
What is difference between array and string?
What are the disadvantages of linked list?
Which is better than array and linked list?
What are the goals of data structure?
Which sorting algorithm uses minimum number of swaps?
How would you swap the Kth node from beginning with Kth node from end in a Linked List.