I apologize to the group; i meant to post as reply to "Find the Max
from each sub-array of size k"  but I accidentally selected the word
"Options" as well.  Sorry.

On Sep 2, 3:42 pm, "icy`" <vipe...@gmail.com> wrote:
> comparison/benchmarks of the
> 1) naive method, which just calls max with every new index, up to size of
> array - k
> 2) my method , which only makes a call to max if the old max is out of range
> or the newest/very rightmost element is greater than max
>
> ruby code:
> [image: max_subarray_text.png]
>
> benchmark output:
> [image: max_subarray_output.png]
>
> To test this, I had shuffled an array of size 1000 with k=25.    I also
> called each method 1000 times, which shows  5x improvement over naive method
>
> icy`
>
>  max_subarray_output.png
> 3KViewDownload
>
>  max_subarray_text.png
> 26KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to