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
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
findBoyerMoore
(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).static int
findBrute
(char[] text, char[] pattern) Returns the lowest index at which substring pattern begins in text (or else -1).static int
findKMP
(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).
-