Home > Back-end > Pray god give directions! Thank humbly! Bubble no cycle is according to the book I taught a step of
Pray god give directions! Thank humbly! Bubble no cycle is according to the book I taught a step of
Time:09-26
Package hellojava;
Public class paixu { Public static void main (String [] args) {//bubble sort Int a []=,32,23,58,3 {1}; for(int i=1; ifor(int j=0; jIf (a [j] <+ 1 a [j]) { Int b=a, a + 1 bonus to [j]. A [j + 1)=b; } } } System. The out. Println (" bubble sort is: "); For (int b: a) { System. The out. Print (b + ""); }
}
} For everyone a great god help me with this code is wrong, thank humbly!
CodePudding user response:
The If (a [j] <+ 1 a [j]) { Int b=a, a + 1 bonus to [j]. A [j + 1)=b; } Change If (a [j] <+ 1 a [j]) {//exchange a [j] and a [m + 1] Int b=a, [j]. A [j]=a, a + 1 bonus to [j]. A [j + 1)=b; }