Question: why can't I sort an array like this ? rather I should do this UN 2 public class sortingArray ( 30 public static void main(String[]args)

 why can't I sort an array like this ? rather I

why can't I sort an array like this ? rather I should do this

should do this UN 2 public class sortingArray ( 30 public static

UN 2 public class sortingArray ( 30 public static void main(String[]args) { int [] array = new int[] {1,6,3,5,2}; int smallByDefault = array[0]; int helper ; for(int i = 0; i 0; j--) { if (array[j]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!