------ Solution ------ --------------------------------------
using bubble sort
- ---- Solution -------------------------------------------- < br> Arrays.sort static method using an array of tools (int [] a);
------ For reference only ----------------- ----------------------
import java.util.Arrays;
public class asdaa {
/ **
* @ param args
* /
public static void main (String [] args) {
int [] nums = {56,23,1,7,8,10,27,32};
for (int i = 0; i
int b = nums [k];
nums [k] = nums [i];
nums [i] = b;
}
System.out.println (Arrays.toString (nums));
}}
没有评论:
发表评论