Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void insertionSort1(int* data, const size_t length) {
- int i, key, j;
- for (i = length-1; i >= 0; i--)
- {
- key = data[i];
- j = i - 1;
- while (j >= 0 && data[j] > key)
- {
- data[j - 1] = data[j];
- j = j - 1;
- }
- data[j - 1] = key;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment