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

Home » Public Forums » archive » Re: Find minimums in an array...
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: Find minimums in an array... [message #32529 is a reply to message #32527] Wed, 16 October 2002 14:00 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
David Fanning wrote:
>
> James Kuyper (kuyper@saicmodis.com) writes:
>
>>> P.S. Let's just say that *this* is what enlightenment
>>> feels like! :-)
>>
>> I feel somewhat unenlightened. Could you be a little more specific?
>
> Well, I just thought "ten lowest values", what a perfect
> job for the histogram function. Divide your array into
> values, then Histogram it, and starting looking in the
> lowest bins. Keep going until you find 10 values! Find
> the locations by using REVERSE_INDICES.... Oh, oh. Hang
> on a second, I've got to go check with the guru...
>
> http://www.dfanning.com/tips/histogram_tutorial.html

I don't believe that the indices, within each bin, refer to the array
entries in sort order. So you'll have to at least sort the elements of
the last bin, to get precisely the 10 smallest items. Unless including
that bin brings the count to precisely 10.

The efficiency of such an algorithm will depend upon the bin size. The
smaller the bin size, the fewer items you'll have to sort in the final
bin, but there will be a corresponding increase in the number of bins
you'll have to look at. The proper choice will depend a lot upon the
distribution of the data. For very clumpy data, this approach won't be
significantly faster than the sort-based approach.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: up/down arrows not working in IDLDE
Next Topic: up/down arrows not working in IDLDE

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

Current Time: Sat Oct 11 07:10:35 PDT 2025

Total time taken to generate the page: 1.35754 seconds