2 ms·
Your bigger problem is with this "trim the array" idea, which is definitely not an obvious solution. The way you've coded it you'd have to tally almost the enti
by abalone 13y ago
Your bigger problem is with this "trim the array" idea, which is definitely not an obvious solution. The way you've coded it you'd have to tally almost the entire days worth of deltas just to determine the trim point. And you may still exceed that single-day max memory, because you'd accumulate overruns in between trims. I'll leave you to think about that one.
(Hint: google round robin database. You know, the solution that I mentioned.)
- hughlomas 13y agoMy comments, as mentioned, were ignoring real memory constraints. I don't know why you feel the need to come off as frustrated.
- bjterry 13y agoInterestingly, based on the explanation at [1] round robin databases actually don't precisely solve the question as described in the article. It sacrifices precision for larger increments, and the author was looking for an exact algorithm. 1: http://jawnsy.wordpress.com/2010/01/08/round-robin-databases/ http://jawnsy.wordpress.com/2010/01/08/round-robin-databases...