Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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