000+/-1].
> The binary search will start off by comparing A[1] with
> B[500,000,000]. If it does not find the median there, it will narrow
> the search down to either A[0] and B[500,000,001] or A[2] and
> B[499,999,999].
> Two steps, which is a lot less than O(3+1,000,000,000).
>
>
As you can see, each time, we are either discarding 1st half of A or second
half of A. Same for B.
So, the total size is getting reduced by factor of 2 every time. So, the
time is log(N) where N = sizeA + sizeB. I hope it is clear.
On Fri, Sep 2, 2011 at 12:47 AM, Rahul Verma wrote:
> @
is message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
>
l to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>>
>> *MOHIT VERMA*
>>
>> --
&g
I need to get all data between two timestamps. So suppose I use
hashtable, I can easily find the starting timestamp. Then how do I look
for all timestamps between the starting timestamp and ending timestamp
in the hashtable.
I have to read a large file where every line is timestamped and the
file is sorted by timestamp. I need to store all that data in some good
data structure so that later on I can easily do calculations on data
between two timestamps meaning I will have to search based on date-time
later.
If I u