in reply to Re: Perl hit counter for multiple ranges, optimization or options in other languages?
in thread Perl hit counter for multiple ranges, optimization or options in other languages?
If you use a slightly different data structure, you could even use a modified binary search to find the proper bucket, resulting in log2(N) comparisons instead of N/2 comparisons (on average).
Update: Ignore this - Laurent_R's solution assumes an already sorted data set and just steps through it. $coffee++.
--MidLifeXis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl hit counter for multiple ranges, optimization or options in other languages?
by Laurent_R (Canon) on Aug 08, 2013 at 14:44 UTC | |
by MidLifeXis (Monsignor) on Aug 08, 2013 at 14:48 UTC |