it is better to use Binary Index Tree ( Fenwick Tree) with time complexity
O(log n) to update and O(n * log n) for finding max overlapping interval .
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees
this link can be useful for understanding how it will work.

Regards,

Ritesh Kumar Mishra
Information Technology
Third Year Undergraduate
MNNIT Allahabad


On Mon, Feb 25, 2013 at 10:46 AM, Sairam <ravu...@gmail.com> wrote:

> First sort the intervals
>>
> So, in our example it will be as follows
> (2,7),(5,10),(6,15).
>
> make a map which has got interval with corresponding number of overlaps
> Now, iterate through each of the interval
>  for(i=0;i<(n-1);i++)
>   for(j=0;j<n;j++)
>      update the map with the number of overlaps.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to algogeeks+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Reply via email to