For example, looking at “searchCeilingOfANumber”, why can’t we add an additional “if” checking the other boundary?
public static int searchCeilingOfANumber(int[] arr, int key) {
if (arr.length == 0) return -1; // trivial edge case
// solution's condition
if (key > arr[arr.length - 1]) // if the 'key' is bigger than the biggest element
return -1;
// my new condition
if (key <= arr[0]) // if the 'key' is smaller or equal than the smallest element, return that element
return arr[0];