in reply to The fastest way of searching a certain element in an array
I'd still check a map solution, just to be sure.
Also, your data is sorted, which means that a linear search on the data is not the most efficient algorithm. You should either implement a binary search, use an existing implementation, or keep your data unsorted.
----
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: The fastest way of searching a certain element in an array
by dragonchild (Archbishop) on Apr 11, 2004 at 03:51 UTC | |
Re: Re: The fastest way of searching a certain element in an array
by ccn (Vicar) on Apr 10, 2004 at 18:49 UTC | |
by hardburn (Abbot) on Apr 10, 2004 at 22:15 UTC |