SkyHawk

Bubble Sort

Jul 6th, 2011
440
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void bubleSort(int* p,int l)
  2. {
  3.     int temp;
  4.     for(int i = 0;i<l;++i)
  5.         for(int q = l-1;q>i;--q)
  6.             if(p[q]<p[q-1])
  7.                 {temp = p[q]; p[q] = p[q-1]; p[q-1] = temp;}
  8. }
RAW Paste Data