0
how many iteration on the last loop?
esp on this part >>> for(int i=0;i<editedArray.length-1;i++){ if (editedArray[i]<editedArray[i+1]){ temp=editedArray[i]; editedArray[i]=editedArray[i+1]; editedArray[i+1]=temp; flag=true; } } if we gave 81, 26, 15, 5, 106 as input how many times for loop here ? ( check the code to get it) https://code.sololearn.com/cNyou0yG8qwh/?ref=app
1 Answer
+ 4
start 81 26 15 5 106
1st 26 15 5 81 106
2nd 15 5 26 81 106
3rd 5 15 26 81 106
4th 5 15 26 81 106
4 loops of while before flag stays false