README
NAME
AlgorithmsIT - Provides some functions from Introduction to Algorithms, Third Edition
SYNOPSIS
use AlgorithmsIT :ALL;
use Classes;
my $P = ArrayOneBased.new: "pattern";
my $T = ArrayOneBased.new: "some text with pattern in it (or not)";
my $pi = ArrayOneBased.new: 1, $T.length; # creates an array: [1, 2, ..., $T.length]
my @matches = KMP-Matcher $T, $P;
say @matches.gist;
# OUTPUT: «[15]» # 15 shifts from the first character to the match position
# The @matches array would be empty if no match were found.
DESCRIPTION
AlgorithmsIT is a collection of a small subset of functions in Reference 1.
See more details at FUNCTIONS
Credits
Thanks to my Raku friend, '@tonyo' (on IRC #raku), for his help with the ArrayOneBased class.
See his many Raku contributions at https://github.com/tony-o/
.
References
1. Thomas H. Cormen, et alii, Introduction to Algorithms, Third Edition, February 2009.
AUTHOR
Tom Browder <[email protected]>
COPYRIGHT AND LICENSE
© 2023 Tom Browder
This library is free software; you may redistribute it or modify it under the Artistic License 2.0.