<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>一花一世界 &#187; 查找算法</title>
	<atom:link href="http://www.juliuschen.com/archives/tag/%e6%9f%a5%e6%89%be%e7%ae%97%e6%b3%95/feed" rel="self" type="application/rss+xml" />
	<link>http://www.juliuschen.com</link>
	<description>谈笑间，樯橹灰飞烟灭</description>
	<lastBuildDate>Sun, 29 Aug 2010 10:32:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>折半查找</title>
		<link>http://www.juliuschen.com/archives/7.html</link>
		<comments>http://www.juliuschen.com/archives/7.html#comments</comments>
		<pubDate>Wed, 09 Dec 2009 15:38:02 +0000</pubDate>
		<dc:creator>Julius Chen</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[二分查找]]></category>
		<category><![CDATA[折半查找]]></category>
		<category><![CDATA[查找算法]]></category>

		<guid isPermaLink="false">http://www.juliuschen.com/archives/7</guid>
		<description><![CDATA[折半查找（二分查找）是一种简单而又高效的查找算法，其查找长度至多为㏒2n+1（判定树的深度），平均查找长度为㏒2(n+1)-1，效率比顺序查找要高，但折半查找只能适用于顺序存储有序表（如对线性链表就无法有效地进行折半查找）。 折半查找的C/C++代码实现： int binary_search(int search_table[], int length, int key) { &#160; &#160; int&#160;low = 0; &#160; &#160; int&#160;high = length - 1; &#160; &#160; while&#160;(low &#60;= high) { &#160; &#160; &#160; &#160; int&#160;mid = (low + high) / 2; &#160; &#160; &#160; &#160; if&#160;(key == search_table[mid]) &#160; &#160; &#160; &#160; &#160; &#160; return&#160;mid; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.juliuschen.com/archives/7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>顺序查找</title>
		<link>http://www.juliuschen.com/archives/6.html</link>
		<comments>http://www.juliuschen.com/archives/6.html#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:36:58 +0000</pubDate>
		<dc:creator>Julius Chen</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[查找算法]]></category>
		<category><![CDATA[顺序查找]]></category>

		<guid isPermaLink="false">http://www.juliuschen.com/archives/6</guid>
		<description><![CDATA[顺序查找（Sequential Search）算法简单，适用面广（对查找表结构无任何要求），但其查找效率较低，等概率下平均查找长度为(n+1)/2。 在条件允许情况下，顺序查找可以设置一个监视哨，目的在于免去查找过程中每一步都要检测整个表是否查找完毕。严版《数据结构》说这个改进能使查找长度在≥1000时查找所需平均时间几乎减少一半。 顺序查找的C/C++代码实现： int seq_search(int search_table[], int length, int key) { &#160; &#160; int&#160;i; &#160; &#160; search_table[0] = key; &#160; &#160; for&#160;(i = length; key != search_table[i]; --i); &#160; &#160; return&#160;i; } 第4行即为设置监视哨，当然监视哨也可以设在高下标处。]]></description>
		<wfw:commentRss>http://www.juliuschen.com/archives/6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
