Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] bubbleSort(int[] data, int index)
- {
- if(index > data.length-1)
- return data;
- else
- {
- for(int count = 0; count < data.length-1; count++)
- {
- if(data[count] > data[count +1] && count + 1 <= data.length)
- {
- int copy = data[count];
- data[count] = data[count+1];
- data[count+1] = copy;
- }
- }
- }
- return bubbleSort(data, index+1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement