| Math :: Kombinatorik. Math :: Combinatorics ist ein Perl-Modul, das Kombinationen und Permutierungen auf Listen ausführen kann. |
Jetzt downloaden |
Math :: Kombinatorik. Ranking & Zusammenfassung
- Lizenz:
- Perl Artistic License
- Name des Herausgebers:
- Allen Day
- Website des Verlags:
- http://search.cpan.org/~birney/bioperl-1.4/Bio/DB/GFF/Aggregator/ucsc_genscan.pm
Math :: Kombinatorik. Stichworte
Math :: Kombinatorik. Beschreibung
Math :: Combinatorics ist ein Perl-Modul, das Kombinationen und Permutationen auf Listen ausführen kann. Math :: Combinatorics ist ein Perl-Modul, das Kombinationen und Permutationen auf Listen ausführen kann. Verwenden Sie Math :: Kombinatorik; mein @n = qw (a b c); meine $ combinat = math :: combinatorics-> neu (count => 2, data => ,); drucken "Kombinationen von 2 von:" .join ("", @ n). "n"; drucken "------------------------------------------". ("-" X Skalar (@n)). "n"; während (my @combo = $ combinat-> next_combination) {drucken Join ('', @combo). "n"; } drucken "n"; drucken "Permutationen von 3 von:" .join ("", @ n). "n"; drucken "------------------------------------------". ("-" X Skalar (@n)). "n"; während (mein @Permu = $ combinat-> next_permutation) {Print Join ('', @Permu). "n"; } Ausgang: oder über exportierte Funktionen verfügbar 'Permut', 'Mähdrescher' und 'Facilialial'. Verwenden Sie Math :: Kombinatorik; mein @n = qw (a b c); drucken "Kombinationen von 2 von:" .join ("", @ n). "n"; drucken "------------------------------------------". ("-" X Skalar (@n)). "n"; drucken Join ("n", map {Join ", @ $ _ _} kombinieren (2, @ n))," n "; drucken "n"; drucken "Permutationen von 3 von:" .join ("", @ n). "n"; drucken "------------------------------------------". ("-" X Skalar (@n)). "n"; Drucken Join ("n", map {Join ", @ $ _ _} Permute (@n))," n "; Ausgabe: Kombinationen von 2 von: ABC ---------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- ABCACBBACBCACABCB AOUTPUT Bei beiden Arten von Anrufen ist derselbe, der objektorientierte Ansatz verbraucht jedoch viel weniger Speicher für große Sätze. Anforderungen: · Perl.
Math :: Kombinatorik. Zugehörige Software