struct GroupData
{
int lower_bound, upper_bound;
float data[ 9 ];
};
vector< GroupData > data_vec;
search you data through data_vec.
If your lower_bound and upper_bound are sorted, use binary search.
If not, sort them when a lot of queries are needed.
Assume that you have 10000 records. about 10 steps(ln1000) are needed
to reach the group data with binary search
[ 此帖被steinlee在2010-04-02 11:26重新编辑 ]