MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / main

Method main

contents/algorithm/code/KMPTest.java:8–20  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6 static StringBuilder match_index;
7
8 public static void main(String[] args) {
9
10 T = "ABABABABBABABABABC";
11 P = "ABABABC";
12
13 N = P.length();
14 fail = new int[N];
15 makeFail(); // fail 함수 만들기
16
17 match_index = new StringBuilder();
18 System.out.println(kmp()); // kmp 함수 : 문자열 T 안에 패턴 P가 몇 번 나타나는지 찾기
19 System.out.print(match_index.toString()); // 패턴이 일치한 시작 인덱스 찾기
20 }
21
22 static void makeFail() {
23 for (int i = 1, j = 0; i < N; i++) {

Callers

nothing calls this directly

Calls 3

makeFailMethod · 0.95
kmpMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected