update at 2023-03-06 20:05:59 by ehlxr
This commit is contained in:
parent
17258f4c05
commit
5427d381f0
@ -7,21 +7,21 @@ import (
|
|||||||
|
|
||||||
func TestBf(t *testing.T) {
|
func TestBf(t *testing.T) {
|
||||||
s := "bacbababaabcbab"
|
s := "bacbababaabcbab"
|
||||||
p := "ababa"
|
p := "abababca"
|
||||||
|
|
||||||
fmt.Printf("bf %s match %s index is: %+v\n", p, s, bf(s, p))
|
fmt.Printf("bf %s match %s index is: %+v\n", p, s, bf(s, p))
|
||||||
// t.Logf("%s match %s index is: %+v\n", p, s, bf(s, p))
|
// t.Logf("%s match %s index is: %+v\n", p, s, bf(s, p))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetNext(t *testing.T) {
|
func TestGetNext(t *testing.T) {
|
||||||
p := "ababa"
|
p := "abababca"
|
||||||
fmt.Printf("getNext %s next is: %+v\n", p, getNext(p))
|
fmt.Printf("getNext %s next is: %+v\n", p, getNext(p))
|
||||||
// t.Logf("%s next is: %+v\n", p, next)
|
// t.Logf("%s next is: %+v\n", p, next)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestKmp(t *testing.T) {
|
func TestKmp(t *testing.T) {
|
||||||
s := "bacbababaabcbab"
|
s := "bacbababaabcbab"
|
||||||
p := "ababa"
|
p := "abababca"
|
||||||
|
|
||||||
fmt.Printf("kmp %s match %s index is: %+v\n", p, s, kmp(s, p))
|
fmt.Printf("kmp %s match %s index is: %+v\n", p, s, kmp(s, p))
|
||||||
// t.Logf("%s match %s index is: %+v\n", p, s, kmp(s, p))
|
// t.Logf("%s match %s index is: %+v\n", p, s, kmp(s, p))
|
||||||
|
Loading…
Reference in New Issue
Block a user