<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《[一道面试题]含有*的字符串匹配问题》的评论</title>
	<atom:link href="http://boundary.cc/200911/string-matching-with-wildcard/feed/" rel="self" type="application/rss+xml" />
	<link>http://boundary.cc/200911/string-matching-with-wildcard/</link>
	<description>Joker Lee&#039;s Blog</description>
	<lastBuildDate>Sat, 29 Oct 2011 09:27:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>作者：JackalDire</title>
		<link>http://boundary.cc/200911/string-matching-with-wildcard/comment-page-1/#comment-148</link>
		<dc:creator>JackalDire</dc:creator>
		<pubDate>Mon, 17 May 2010 13:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://jackaldire.com/?p=76#comment-148</guid>
		<description>@crowsy, 你是说改进的算法么？不好意思改进算法原来有个地方写错了，第13行应该是 if (!s[p] &amp;&amp; !t[q]) { 原来少了两个非号。</description>
		<content:encoded><![CDATA[<p>@crowsy, 你是说改进的算法么？不好意思改进算法原来有个地方写错了，第13行应该是 if (!s[p] &#038;&#038; !t[q]) { 原来少了两个非号。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：crowsy</title>
		<link>http://boundary.cc/200911/string-matching-with-wildcard/comment-page-1/#comment-147</link>
		<dc:creator>crowsy</dc:creator>
		<pubDate>Mon, 17 May 2010 11:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://jackaldire.com/?p=76#comment-147</guid>
		<description>一样？  惭愧没看懂你的。 
你的似乎测试不过呀。</description>
		<content:encoded><![CDATA[<p>一样？  惭愧没看懂你的。<br />
你的似乎测试不过呀。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：JackalDire</title>
		<link>http://boundary.cc/200911/string-matching-with-wildcard/comment-page-1/#comment-146</link>
		<dc:creator>JackalDire</dc:creator>
		<pubDate>Sun, 16 May 2010 13:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://jackaldire.com/?p=76#comment-146</guid>
		<description>@crowsy, 这个不是和我的第一个算法一样么，都是暴力搜索；这个和普通的字符串匹配的过程不一样。普通的字符串匹配没有递归，所以只是len(s)*len(t)的复杂度。</description>
		<content:encoded><![CDATA[<p>@crowsy, 这个不是和我的第一个算法一样么，都是暴力搜索；这个和普通的字符串匹配的过程不一样。普通的字符串匹配没有递归，所以只是len(s)*len(t)的复杂度。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：crowsy</title>
		<link>http://boundary.cc/200911/string-matching-with-wildcard/comment-page-1/#comment-145</link>
		<dc:creator>crowsy</dc:creator>
		<pubDate>Sun, 16 May 2010 12:54:05 +0000</pubDate>
		<guid isPermaLink="false">http://jackaldire.com/?p=76#comment-145</guid>
		<description>没有看明白你的思路。
我认为没有要求最大或者最小匹配 所以直接字符比较就可以了 函数如下
bool is_match(const char * s, const char * t)
{
    //记忆源字符串的开始位置和匹配串的开始位置 
    const char *srcFirst = s;
    const char *mathFirst = t;
    
    while (*s &amp;&amp; *t)
    {
        //匹配到* 匹配下面一个域 
        if(&#039;*&#039; == *t) return is_match(s,++t);

        //匹配到不一样的时 源字符串返回到开始位置+1 匹配字符串返回到开始位置 
        if (*t != *s){
               s = srcFirst++;
               t = mathFirst;
               continue;
        } 
        s++;
        t++;           
    }  
    
    //遍历完返回 
    if(!*t) return true;     
    return false;
}</description>
		<content:encoded><![CDATA[<p>没有看明白你的思路。<br />
我认为没有要求最大或者最小匹配 所以直接字符比较就可以了 函数如下<br />
bool is_match(const char * s, const char * t)<br />
{<br />
    //记忆源字符串的开始位置和匹配串的开始位置<br />
    const char *srcFirst = s;<br />
    const char *mathFirst = t;</p>
<p>    while (*s &amp;&amp; *t)<br />
    {<br />
        //匹配到* 匹配下面一个域<br />
        if(&#8216;*&#8217; == *t) return is_match(s,++t);</p>
<p>        //匹配到不一样的时 源字符串返回到开始位置+1 匹配字符串返回到开始位置<br />
        if (*t != *s){<br />
               s = srcFirst++;<br />
               t = mathFirst;<br />
               continue;<br />
        }<br />
        s++;<br />
        t++;<br />
    }  </p>
<p>    //遍历完返回<br />
    if(!*t) return true;<br />
    return false;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Blinux</title>
		<link>http://boundary.cc/200911/string-matching-with-wildcard/comment-page-1/#comment-68</link>
		<dc:creator>Blinux</dc:creator>
		<pubDate>Thu, 03 Dec 2009 11:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://jackaldire.com/?p=76#comment-68</guid>
		<description>:x</description>
		<content:encoded><![CDATA[<p> <img src='http://boundary.cc/wordpress/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

