Skip to content

Commit b3ced50

Browse files
committed
Changed methods to private
1 parent 3e1ec96 commit b3ced50

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/algorithms/sorting/quickSort/hoares/QuickSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void sort(int[] arr) {
3030
* @param start the starting index (inclusive) of the sub-array to be sorted.
3131
* @param end the ending index (inclusive) of the sub-array to be sorted.
3232
*/
33-
public static void quickSort(int[] arr, int start, int end) {
33+
private static void quickSort(int[] arr, int start, int end) {
3434
if (start < end) {
3535
int pIdx = partition(arr, start, end);
3636
quickSort(arr, start, pIdx - 1);

src/algorithms/sorting/quickSort/lomuto/QuickSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void sort(int[] arr) {
5959
* @param start the starting index (inclusive) of the sub-array to be sorted.
6060
* @param end the ending index (inclusive) of the sub-array to be sorted.
6161
*/
62-
public static void quickSort(int[] arr, int start, int end) {
62+
private static void quickSort(int[] arr, int start, int end) {
6363
if (start < end) {
6464
int pIdx = partition(arr, start, end);
6565
quickSort(arr, start, pIdx - 1);

src/algorithms/sorting/quickSort/paranoid/QuickSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static void sort(int[] arr) {
5050
* @param start the starting index (inclusive) of the sub-array to be sorted.
5151
* @param end the ending index (inclusive) of the sub-array to be sorted.
5252
*/
53-
public static void quickSort(int[] arr, int start, int end) {
53+
private static void quickSort(int[] arr, int start, int end) {
5454
if (start < end) {
5555
int pIdx = partition(arr, start, end);
5656
if (isGoodPivot(pIdx, start, end)) { //check to guarantee good pivot

src/algorithms/sorting/quickSort/threeWayPartitioning/QuickSort.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void sort(int[] arr) {
4848
* @param start the starting index (inclusive) of the sub-array to be sorted.
4949
* @param end the ending index (inclusive) of the sub-array to be sorted.
5050
*/
51-
public static void quickSort(int[] arr, int start, int end) {
51+
private static void quickSort(int[] arr, int start, int end) {
5252
if (start < end) {
5353
int[] newIdx = partition(arr, start, end);
5454
if (isGoodPivot(newIdx[0], newIdx[1], start, end)) {
@@ -164,7 +164,7 @@ private static int random(int start, int end) {
164164
* @param end The ending index of the current sub-array.
165165
* @return True if the given index is a good pivot, false otherwise.
166166
*/
167-
public static boolean isGoodPivot(int firstPIdx, int secondPIdx, int start, int end) {
167+
private static boolean isGoodPivot(int firstPIdx, int secondPIdx, int start, int end) {
168168
int n = end - start + 1;
169169
if (firstPIdx >= start || secondPIdx <= end) {
170170
if (end - secondPIdx + 1 > 0) { // avoid division by zero

0 commit comments

Comments
 (0)