We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c83f01 commit 9416371Copy full SHA for 9416371
src/test/java/com/thealgorithms/searches/BinarySearch.java
@@ -1,7 +1,10 @@
1
package com.thealgorithms.searches;
2
3
class BinarySearch {
4
-
+ // Private constructor to prevent instantiation
5
+ private BinarySearch() {
6
+ throw new UnsupportedOperationException("Utility class");
7
+ }
8
// Enhanced binary search method
9
public static int binarySearch(int[] arr, int target) {
10
// Edge case: If the array is empty
0 commit comments