Your description suggests that your data are all integers - is this the case? If so there will be a lot of duplicate data points so you can first of all tot up all the same integers into a hash. Only once you have done that should you think about putting them into the bins.
You should then sort the keys of your totals hash and the keys of your bins hash so you only have to step through each hash once.
You could do this in any language, but perl will probably be as good as most. Have a look in your favourite algorithms book as this is not an uncommon sort of task and will be covered there in detail.
In reply to Re: Perl hit counter for multiple ranges, optimization or options in other languages?
by hippo
in thread Perl hit counter for multiple ranges, optimization or options in other languages?
by SaktiMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |