Java : Sort integer array without using Arrays.sort()

后端 未结 12 2600
滥情空心
滥情空心 2021-02-14 00:59

This is the instruction in one of the exercises in our Java class. Before anything else, I would like to say that I \'do my homework\' and I\'m not just being lazy asking someon

12条回答
  •  温柔的废话
    2021-02-14 01:41

    here is the Sorting Simple Example try it

    public class SortingSimpleExample {
    
        public static void main(String[] args) {
            int[] a={10,20,1,5,4,20,6,4,2,5,4,6,8,-5,-1};
                  a=sort(a);
            for(int i:a)
                  System.out.println(i);
    }
        public static int[] sort(int[] a){
    
            for(int i=0;i

提交回复
热议问题