<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>KMP on PlumePHP</title><link>https://plumephp.com/tags/kmp/</link><description>Recent content in KMP on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 27 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://plumephp.com/tags/kmp/index.xml" rel="self" type="application/rss+xml"/><item><title>17. 字符串算法</title><link>https://plumephp.com/cs-string-algorithms/</link><pubDate>Sun, 27 Sep 2026 00:00:00 +0000</pubDate><guid>https://plumephp.com/cs-string-algorithms/</guid><description>&lt;h2 id="1-字符串匹配问题与朴素匹配"&gt;1. 字符串匹配问题与朴素匹配&lt;/h2&gt;
&lt;h3 id="11-问题定义"&gt;1.1 问题定义&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;字符串匹配&lt;/strong&gt;：给定文本串 text（长度 n）与模式串 pattern（长度 m），在 text 中查找所有与 pattern 相等的位置。匹配算法的核心目标是&lt;strong&gt;减少字符比较次数&lt;/strong&gt;，将最坏情况从 O(n·m) 降到 O(n+m)。&lt;/p&gt;</description></item></channel></rss>