in reply to Re: performance issues with grepping large sorted arrays
in thread performance issues with grepping large sorted arrays
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: performance issues with grepping large sorted arrays
by almut (Canon) on Jul 24, 2007 at 00:16 UTC | |
by gam3 (Curate) on Jul 24, 2007 at 14:25 UTC | |
by mr_mischief (Monsignor) on Jul 24, 2007 at 16:43 UTC | |
by almut (Canon) on Jul 24, 2007 at 17:35 UTC | |
by mr_mischief (Monsignor) on Jul 24, 2007 at 20:13 UTC |