No such thing as a small change | |
PerlMonks |
Re^2: performance issues with grepping large sorted arraysby Trizor (Pilgrim) |
on Jul 23, 2007 at 23:34 UTC ( [id://628361]=note: print w/replies, xml ) | Need Help?? |
Arrays don't require a linear search, see my post about binary search. It requires a sorted array, but if you've already got that... In terms of algorithmic complexity short circuiting has no impact on efficiency because the worst case is still O(n) and the average case is O(n/2) which simplifies to O(n), which is still greater than O(lg n)
In Section
Seekers of Perl Wisdom
|
|