Guest User

Untitled

a guest
Apr 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. void Insertion()
  2. {
  3. unsigned short i,j;
  4. unsigned int x;
  5.  
  6. for (i=1; i<N; i++)
  7. {
  8. j = i;
  9. while (j>0 && A[j]>A[j-1])
  10. {
  11. x=A[j];
  12. A[j]=A[j-1];
  13. A[j-1]=x;
  14. j--;
  15. }
  16. }
  17. for (i=0; i<N;i++)
  18. cout << A[i] << endl;
  19. }
Add Comment
Please, Sign In to add comment