Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public static void insertSort(int[] arr){
  2.  
  3. int x, y;
  4. for(y=1; y< arr.length; y++) {
  5. int temp = arr[y];
  6. x = y;
  7. while(x>0 && arr[x-1] >= temp){
  8. arr[x] = arr[x-1];
  9. --x;
  10. }
  11. arr[x] = temp;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement