Algorithm::MedianSelect::XS - Median finding algorithm
use Algorithm::MedianSelect::XS qw(median); @numbers = (21, 6, 2, 9, 5, 1, 14, 7, 12, 3, 19); print median(@numbers); print median(\@numbers); print median(\@numbers, { algorithm => 'bubble' }); # slow algorithm print median(\@numbers, { algorithm => 'quick' }); # default algorithm
Algorithm::MedianSelect::XS finds the item which is smaller than half of the integers and bigger than half of the integers.
Algorithm::MedianSelect::XS
Takes a list or reference to list of integers and returns the median number. Optionally, the algorithm being used for computation may be specified within a hash reference. See SYNOPSIS for algorithms currently available.
median() is exportable.
median()
http://www.cs.sunysb.edu/~algorith/files/median.shtml
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Algorithm::MedianSelect::XS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::MedianSelect::XS
CPAN shell
perl -MCPAN -e shell install Algorithm::MedianSelect::XS
For more information on module installation, please visit the detailed CPAN module installation guide.