Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void insertSort(int[] arr){
- int x, y;
- for(y=1; y< arr.length; y++) {
- int temp = arr[y];
- x = y;
- while(x>0 && arr[x-1] >= temp){
- arr[x] = arr[x-1];
- --x;
- }
- arr[x] = temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement