Guest User

Untitled

a guest
Oct 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. help=n/2;
  2. while(help>0)
  3. i=0;
  4. while(i<n)
  5. {
  6. j=i-help;
  7. while(j>=0)
  8. {
  9. if(a[j]>a[j+help])
  10. {
  11. temp=a[j];
  12. a[j]=a[j+help];
  13. a[j+help]=temp;
  14. }
  15. j=j-help;
  16. }
  17. i=i+1;
  18. }
  19. help=help/2;
Add Comment
Please, Sign In to add comment