Binary Search in Java is not working properly without sorting it first.
opened this issue · comments
Deleted user commented
public class BinarySearch {
public static void main(String[] args) {
int[] myList = {87, 21, 45, 93};
//add this line Arrays.sort(myList);
System.out.println(binarySearch(myList, 93));
I might be wrong, I am just a newbie