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
What is stack explain with diagram?
What are arrays used for?
What are the classification of data structures?
What is dynamic array how is it created?
What is the non linear data structure?
Write the recursive c function to count the number of nodes present in a binary tree.
Why concurrenthashmap is fail safe?
What is the best time complexity of bubble sort?
Define a complete binary tree?
What exactly is data?
Are the expressions arr and &arr same for an array of integers?
Write the importance of hashing?
What is an recursive algorithm?
Differentiate between comparable and comparator.
How do you sort large data?