Skip to content

Instantly share code, notes, and snippets.

@begeekmyfriend
Last active October 4, 2023 08:18
Show Gist options
  • Save begeekmyfriend/70e96c5a97eb260ac02b9e05e096f728 to your computer and use it in GitHub Desktop.
Save begeekmyfriend/70e96c5a97eb260ac02b9e05e096f728 to your computer and use it in GitHub Desktop.
void sort(int *nums, int size)
{
int i, j;
for (i = 1; i < size; i++) {
int tmp = nums[i];
for (j = i; j > 0 && tmp < nums[j - 1]; j--) {
nums[j] = nums[j - 1];
}
nums[j] = tmp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment