mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 20:20:56 +08:00
Merge pull request #1354 from thecoderenroute/master
Fixing errors and warnings
This commit is contained in:
@ -53,8 +53,8 @@ class threesum{
|
|||||||
else r--;
|
else r--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sc.close();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,8 @@
|
|||||||
|
package Sorts;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class Bucket_Sort
|
public class BucketSort
|
||||||
{
|
{
|
||||||
static int[] sort(int[] sequence, int maxValue)
|
static int[] sort(int[] sequence, int maxValue)
|
||||||
{
|
{
|
||||||
|
@ -10,10 +10,12 @@ public class SelectionSort implements SortAlgorithm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method swaps the two elements in the array
|
* This method swaps the two elements in the array
|
||||||
|
* @param <T>
|
||||||
* @param arr, i, j The array for the swap and
|
* @param arr, i, j The array for the swap and
|
||||||
the indexes of the to-swap elements
|
the indexes of the to-swap elements
|
||||||
*/
|
*/
|
||||||
public void swap(T[] arr, int i, int j) {
|
|
||||||
|
public <T> void swap(T[] arr, int i, int j) {
|
||||||
T temp = arr[i];
|
T temp = arr[i];
|
||||||
arr[i] = arr[j];
|
arr[i] = arr[j];
|
||||||
arr[j] = temp;
|
arr[j] = temp;
|
||||||
|
Reference in New Issue
Block a user