Skip to content

Commit 9416371

Browse files
authored
Update BinarySearch.java
1 parent 4c83f01 commit 9416371

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/com/thealgorithms/searches/BinarySearch.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.thealgorithms.searches;
22

33
class BinarySearch {
4-
4+
// Private constructor to prevent instantiation
5+
private BinarySearch() {
6+
throw new UnsupportedOperationException("Utility class");
7+
}
58
// Enhanced binary search method
69
public static int binarySearch(int[] arr, int target) {
710
// Edge case: If the array is empty

0 commit comments

Comments
 (0)