From 5150a6bd875b24bf98ba693980e5d78a2be03a05 Mon Sep 17 00:00:00 2001 From: Hardik Kapadia Date: Tue, 30 Jun 2020 00:14:04 +0530 Subject: [PATCH 1/2] Closed Scanner in 3 sum, fixed syntax errors in BucketSort.java --- Others/3 sum.java | 2 +- Sorts/BucketSort.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Others/3 sum.java b/Others/3 sum.java index 577044aab..5723ba49c 100644 --- a/Others/3 sum.java +++ b/Others/3 sum.java @@ -53,8 +53,8 @@ class threesum{ else r--; } } - + sc.close(); } } \ No newline at end of file diff --git a/Sorts/BucketSort.java b/Sorts/BucketSort.java index 7556faf57..1d2e94ff2 100644 --- a/Sorts/BucketSort.java +++ b/Sorts/BucketSort.java @@ -1,7 +1,8 @@ +package Sorts; import java.util.Random; -public class Bucket_Sort +public class BucketSort { static int[] sort(int[] sequence, int maxValue) { From d07e6680919d4bad06c7f687fa04895ec571face Mon Sep 17 00:00:00 2001 From: Hardik Kapadia Date: Tue, 30 Jun 2020 00:17:48 +0530 Subject: [PATCH 2/2] Fixed parameter error in SelectionSort --- Sorts/SelectionSort.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sorts/SelectionSort.java b/Sorts/SelectionSort.java index e6b7c8833..31b16c5bb 100644 --- a/Sorts/SelectionSort.java +++ b/Sorts/SelectionSort.java @@ -10,10 +10,12 @@ public class SelectionSort implements SortAlgorithm { /** * This method swaps the two elements in the array + * @param * @param arr, i, j The array for the swap and the indexes of the to-swap elements */ - public void swap(T[] arr, int i, int j) { + + public void swap(T[] arr, int i, int j) { T temp = arr[i]; arr[i] = arr[j]; arr[j] = temp;