tinyporo / algorithm
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/tinyporo/algorithm
This package is auto-updated.
Last update: 2025-10-09 21:52:35 UTC
README
Poro researching on algorithms.
Usage
1.String Searching
First, create searching object with algorithm you want with the argument is the FullString
, example below describle how to create object with BruteForce
searching algorithm.
$StringSearching = new \Poro\Algorithm\StringSearching\BruteForce('FullString');
Then, we can find all the position of a SearchString
in the String
with function run
:
$result = $StringSearching->run(SearchString);
With Morris-Pratt
, there is a better version call Knuth-Morris-Pratt
. By default, the morris-pratt-object will run with the better version. But if you want to use with normal version, you can pass 1/MorrisPratt::MORRIS_PRATT as the second argument of run
function