int binary_search(int[] list, int item) { int low = 0; int high = list.length-1; while (low <= high) { int mid = int((low + high)/2); int guess = list[mid]; if (guess == item) { return mid; } if (guess > item) { high = mid -1; } else { low = mid+1;…
import java.util.Map; // Note the HashMap's "key" is a String and "value" is an Integer HashMap<String,Integer> hm = new HashMap<String,Integer>(); // Putting key-value pairs in the HashMap hm.put("Ava", 1); hm.pu…