Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Insertion()
- {
- unsigned short i,j;
- unsigned int x;
- for (i=1; i<N; i++)
- {
- j = i;
- while (j>0 && A[j]>A[j-1])
- {
- x=A[j];
- A[j]=A[j-1];
- A[j-1]=x;
- j--;
- }
- }
- for (i=0; i<N;i++)
- cout << A[i] << endl;
- }
Add Comment
Please, Sign In to add comment