Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] Max in an array

Expand Messages
  • merlyn@stonehenge.com
    ... srinivas Would you please let me know the efficient way (different ways) to get the srinivas max or nth largest element in an array use List::Util; my
    Message 1 of 3 , Aug 30, 2007
      >>>>> "srinivas" == srinivas reddy <reddysrinivas.k@...> writes:

      srinivas> Would you please let me know the efficient way (different ways) to get the
      srinivas> max or nth largest element in an array

      use List::Util;
      my $max = max(@some_array);

      That's the most efficient, because it's implemented in C. :)

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.