Difficulty Level: EASY
Problem Statement:
Given a sorted array and a value x, the ceiling of x is the smallest element in an array greater than or equal to x, and the floor is the greatest element smaller than or equal to x. Assume that the array is sorted in non-decreasing order. Write efficient functions to find the floor and ceiling of x.
Input:
arr[] = {3, 4, 5, 12, 12, 15, 20}, X = 7
Output:
Ceiling of 7 is 12