can we use binary_search only in sorted array.
Yes , the array need to be sorted to perform binary search .