Hello
I am learning java and I am practising the bubble sort. I understand everything except.....
Could someone please explain the reason for using the -1 value after // numbers.length-1 in the 2nd for loop?
I am learning java and I am practising the bubble sort. I understand everything except.....
Could someone please explain the reason for using the -1 value after // numbers.length-1 in the 2nd for loop?
//more code here
for(int i=1; i<numbers.length; i++){
for(int j = 0; j < numbers.length-1; j++)
//more code here