Given an infinite length sorted array having both positive and negative integers. Find an element in it.
EDIT All the elements in the array are
Here is another implementation which use 2^n to search occurrence of element itself, and then gives this sub-array to binary search
e.g. arr = 1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1........... num = 8; efficiency = 2logn