Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
public static void sort(int[] nums){
|
||||
for(int currentPlace = 0;currentPlace<nums.length-1;currentPlace++){
|
||||
int smallest = Integer.MAX_VALUE;
|
||||
int smallestAt = currentPlace+1;
|
||||
for(int check = currentPlace; check<nums.length;check++){
|
||||
if(nums[check]<smallest){
|
||||
smallestAt = check;
|
||||
smallest = nums[check];
|
||||
}
|
||||
}
|
||||
int temp = nums[currentPlace];
|
||||
nums[currentPlace] = nums[smallestAt];
|
||||
nums[smallestAt] = temp;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue