Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bubble(int a[],int n)
- {
- int i,schimbat,aux;
- do {
- schimbat = 0;
- // parcurgem vectorul
- for(i = 0; i < n-1; i++) {
- if (a[i] > a[i+1]) {
- aux = a[i];
- a[i] = a[i+1];
- a[i+1] = aux;
- schimbat = 1;
- }
- }
- } while(schimbat);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement