课后题 数据结构 串的模式匹配 选择题
第 3 题

设主串的长度为 n, 子串的长度为 m, 则简单的模式匹配算法的时间复杂度为(), KMP 算法的时间复杂度为()。

A. O(m) B.O(n) C.O( mn) D.O(m + n)

[tag_link]

正确答案: