I have some time series data, which contains various parameters read over a period of time as varying intervals.
I am working on a replay interface for the data. I want to allow the retrial of a value at any point in time. The value being calculated by simple straight line between the nearest two points, the one before and the one at or after the given time. What I need is a data structure like a sorted dictionary, which returns the nearest value before and the nearest value after. Obviously one way would to be to do the calculations first and fill out the data so all the data is equally spaced. Then retrieval is fairly simple. However this is fairly space inefficient because the interval needs to be equal to the distance between the two closest points. Performance good though. I was thinking perhaps I could use a sort of linked list/tree structure. So I search for the nearest entry prior, then follow the link to the next following. Any suggestion? Jeff