in reply to Re: Data structure advice
in thread Data structure advice

And, do you only ever care about a single day at a time?

I'd be tempted to load all the data into a hash, then use a tie interface that computes what the closest preceding data point would be and returns the value corresponding to it.

As with most questions of this sort, the proof is in the benchmarking, and if you really want to optimize for search speed, you'll want to benchmark.

Replies are listed 'Best First'.
Re: Re: Re: Data structure advice
by robinbowes (Beadle) on Jan 05, 2004 at 20:47 UTC
    Hi Zed,

    I do only care about a single day at a time and, to answer a question from a previous reply, I will be loading all 48 values before processing the many thousands of data points which require the look up.

    The tie interface looks like what I need; I'll have a scout around for information on that. Can you point me at any suitable examples?

    Cheers,

    R.

    --

    Robin Bowes | http://robinbowes.com