๐น Linear Search in Java public class LinearSearch { public static int linearSearch ( int [] arr, int key) { for ( int i = 0 ; i < arr.length; i++) { if (arr[i] == key) return i; } return - 1 ; // Not found } public static void main (String[] args) { int [] arr = { 5 , 3 , 8 , 2 , 9 }; int key = 8 ; int index = linearSearch(arr, key); System.out.println( "Element found at index: " + index); } } ๐น Binary Search in Java (Iterative) public class BinarySearch { public static int binarySearch ( int [] arr, int key) { int start = 0 , end = arr.length - 1 ; while (start <= end) { int mid = start + (end - start) / 2 ; if (arr[mid] == key) return mid; else if (arr[mid] < key) start = mid + 1 ; else end = mid - 1 ; } return - 1 ; } public static voi...