comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Array searching efficiency
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Array searching efficiency [message #75048 is a reply to message #74959] Fri, 11 February 2011 07:35 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Feb 10, 7:47 pm, Matt Francis <mattjamesfran...@gmail.com> wrote:
> On Feb 11, 11:44 am, Matt Francis <mattjamesfran...@gmail.com> wrote:
>
>>> I would shocked if it wasn't several orders of magnitude faster
>>> (for this many iterations) to Histogram your times array with some
>>> appropriate bin size and then ask "which bin" your time_now
>>> was in with Value_Locate.
>
>> Thanks David, VALUE_LOCATE is exactly the function I'm looking for.
>
> Thanks also to Paulo, who ninja'd my previous post.

As a general comment, from a basic algorithmic point of view,
finding one element in a sorted array is a log(N) kind of problem.

An example of an algorithm that does this is bisection:
go to the middle of the array - check if the wanted item
is left or right, then go to the middle of that side, check
in which quarter the element is, rinse and repeat.

Ciao,
Paolo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: reading and writing very slow
Next Topic: possible bug with center keyword option for FFT

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:48:28 PDT 2025

Total time taken to generate the page: 0.71826 seconds