Java implementation of a Knuth-Morris-Pratt string searching algorithm.
Wikipedia
Implemented using Sedgewick & Waynes version.
To begin with compile all java files.
make
Search for a needle in a haystack.
make example
Run with the bus services real-time information text file (sourced from Translink Developer API).
make buses
Search for your own needle in a haystack_.
make find
make find
Enter the pattern you would like to search for:
needle
Enter the string you would like to search for this pattern in:
haystack
Pattern entered = needle
Text entered = haystack
Checking if text 'haystack' contains the pattern 'needle'...
Pattern not found!