Find ceiling of target element in a sorted array
Problem Given a sorted array and a value x, the ceiling of x in sorted array. Assume than the array is sorted in non-decreasing order. Write efficient functions to find floor and ceiling of x. Definition the ceiling of x is the smallest element in array greater than or equal to x. Examples Example 1: Input: arr = [1, 2, 4, 6, 10, 12, 14], x = 5 Output: 6 Explanation: The smallest element greater than or equal to 5 is 6. ...