Search array element binarySearch()

Arrays.binarySearch() method is useful to find out the index number of an element in the array. Two methods exist in the Arrays class for the purpose and following are their method signatures static int binarySearch(int array1[], int searchNum): Searches the element searchNum in the array array1. This method should be used in combination with sort() …

Search array element binarySearch() Read More »