Merge pull request #1354 from thecoderenroute/master

Fixing errors and warnings
This commit is contained in:
Stepfen Shawn
2020-07-06 20:33:32 -05:00
committed by GitHub
3 changed files with 6 additions and 3 deletions

View File

@ -53,8 +53,8 @@ class threesum{
else r--; else r--;
} }
} }
sc.close();
} }
} }

View File

@ -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)
{ {

View File

@ -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;