Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


simple algorithm for bubble sort?



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

Post New Answer

More Data Structures Interview Questions

Does arraylist have a tostring?

0 Answers  


What is the difference between linked list and array?

0 Answers  


Explain quick sort and merge sort algorithms and derive the time-constraint relation for these.

0 Answers   MNB,


Define depth and height of a node?

0 Answers  


What is doubly linked list in data structure?

0 Answers  


What is max heapify?

0 Answers  


What is the difference between list, set and map?

0 Answers  


By Which algorithm, the 8 queens problem is solved?

0 Answers  


Define degree of the node?

0 Answers  


what is atmost complete binary tree?

6 Answers  


What do you mean by probing?

0 Answers  


What is time complexity of binary search?

0 Answers  


Categories