Package com.zybooks.dsaj.text
Class PatternMatching
java.lang.Object
com.zybooks.dsaj.text.PatternMatching
Implementation of several pattern-matching algorithms on character sequences.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intfindBoyerMoore(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).static intfindBrute(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).static intfindKMP(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).
-
Constructor Details
-
PatternMatching
public PatternMatching()
-
-
Method Details
-
findBrute
public static int findBrute(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1). -
findBoyerMoore
public static int findBoyerMoore(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1). -
findKMP
public static int findKMP(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).
-