Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created February 13, 2011 21:36
Show Gist options
  • Save llimllib/825161 to your computer and use it in GitHub Desktop.
Save llimllib/825161 to your computer and use it in GitHub Desktop.
for(a=1; a<size; a++)
for(b=size-1; b>=a; b--) {
if(nums[b-1] > nums[b]) { // if out of order
// exchange elements
t = nums[b-1];
nums[b-1] = nums[b];
nums[b] = t;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment