Algorithm::Sorting - Provide various sorting methods.
use Algorithm::Sorting; my @list=(1, "hello", 123, "abc"); BubbleSort(\@list); print "@list\n"; #will print the sorted list.
In this module, there are many very general sorting Algorithms written for Perl. Those are
Bubble Sort Shaker Sort Selection Sort Insertion Sort Shell Sort Quick Sort
Here, all subroutines have same syntax to use.
BubbleSort(\@array); print "@array\n";
ShakerSort(\@array); print "@array\n";
SelectionSort(\@array); print "@array\n";
InsertionSort(\@array); print "@array\n";
ShellSort(\@array); print "@array\n";
QuickSort(\@array); print "@array\n";
Algorithm and Algorithm::Searching
Vipin Singh, <qwer@cpan.org>
Copyright (C) 2013 by Vipin Singh
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.3 or, at your option, any later version of Perl 5 you may have available.
To install Algorithm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm
CPAN shell
perl -MCPAN -e shell install Algorithm
For more information on module installation, please visit the detailed CPAN module installation guide.