> I see no reason to use a sorted heap, a plain list > of ranges would do as well. This will lead to O(N) algo, i prefer O(lgN).
> Once again, why? Even if you a heap sorted by range size, > just take the smallest one, and pick the min value. After > reducing the range by one, if it's zero - get rid of it, > otherwise, the heap will still be sorted by size since > the smallest range will still be the smallest. I like this solution it will be faster, but I see a small error instead of decreasing the min you should increase it, or decrease the max. Best, Ridvan --~--~---------~--~----~------------~-------~--~----~ You received this 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---