Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bubble_sort(int * V, int N, int * perm){
- int * iter = 0;
- Boolean iter_without.swap = FALSE;
- Boolean swap_found;
- while(iter_without.swap == FALSE){
- for(count=0, swap_found=FALSE; count<N-iter-1; count++){
- if(v[perm[count]] > v[perm[count+1]]){
- swap(perm, count, count+1);
- swap_found = TRUE;
- }
- }
- if(swap_found==FALSE)
- iter_without.swap = TRUE;
- else
- iter++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement