To search for an element in an infinite sorted array, we can use binary search.
However, to apply binary search, we need to find the end index.
To find the end index in an infinite array, we can start with a starting index and double the end index until we find an element greater than the key element.
Once we have the start and end indexes, we can apply binary search to find the key element's position.