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 |
Explain the applications of stack?
Differentiate between list and set.
Why we use arraylist instead of linked list?
Which is faster hashmap or linkedhashmap?
How do you do a selection sort?
Define threaded binary tree.
why do tree always takes o(log n) time?
What is meant by ordered and sorted in collections?
Why do we use arrays?
Differentiate between singly and doubly linked lists?
On clicking a node in a tree, all the adjacent edges are turned on. Calculate min of clicks such that all the edges are turned on.
How do I rearrange rows in numbers?