Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int StraightInsertionSort( int *m, int n )
- {
- int i, j, temp, col1=0;
- for (i = 1; i < n; i++)
- {
- temp = m[i];
- col1+=1;
- for (j = i - 1; j >= 0; j--)
- {
- if (m[j] < temp)
- break;
- m[j + 1] = m[j];
- col1+=1;
- }
- m[j] = temp;
- col1+=1;
- }
- return col1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement