forked from pr2-lecture/examples
22 lines
533 B
Java
22 lines
533 B
Java
package pr2.algorithmen.textsearch;
|
|
|
|
public class TestTextSearch {
|
|
public static void main(String[] args) {
|
|
|
|
String haystack = "DASISTEINSINNLOSERTEXT";
|
|
String needle = "SINN";
|
|
|
|
TextSearch bf = new BruteForceTextSearch();
|
|
System.out.println(bf.search(haystack, needle));
|
|
|
|
TextSearch kmp = new KMPTextSearch();
|
|
System.out.println(kmp.search(haystack, needle));
|
|
|
|
TextSearch bm = new BoyerMooreTextSearch();
|
|
System.out.println(bm.search(haystack, needle));
|
|
|
|
|
|
|
|
}
|
|
}
|