<?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"
	>
<channel>
	<title>相關評論：[轉載]學程式設計的人不能不看的好文章</title>
	<atom:link href="http://www.vixual.net/blog/archives/99/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vixual.net/blog/archives/99</link>
	<description>網路、空氣、水</description>
	<pubDate>Wed, 07 Jan 2009 00:09:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>作者：egg</title>
		<link>http://www.vixual.net/blog/archives/99#comment-134</link>
		<dc:creator>egg</dc:creator>
		<pubDate>Sat, 20 Sep 2008 17:43:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.vixual.net/blog/?p=99#comment-134</guid>
		<description>long fn(long n) {
  if(n 0);
    exit(1);
  }
  if(0==n%2)
    return (n/2)*(-1);
  else
    return (n/2)*(-1)+n;
}


在爬文時看到這篇
有個小小的錯誤

  if(0==n%2)
    return (n/2)*(-1);
  else
    return (n/2-0.5)*(-1)+n;

當N為單數時,要捨去</description>
		<content:encoded><![CDATA[<p>long fn(long n) {<br />
  if(n 0);<br />
    exit(1);<br />
  }<br />
  if(0==n%2)<br />
    return (n/2)*(-1);<br />
  else<br />
    return (n/2)*(-1)+n;<br />
}</p>
<p>在爬文時看到這篇<br />
有個小小的錯誤</p>
<p>  if(0==n%2)<br />
    return (n/2)*(-1);<br />
  else<br />
    return (n/2-0.5)*(-1)+n;</p>
<p>當N為單數時,要捨去</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Anonymous</title>
		<link>http://www.vixual.net/blog/archives/99#comment-4</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 30 Oct 2007 03:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.vixual.net/blog/?p=99#comment-4</guid>
		<description>程式設計師本來就必須要想到程式的執行效率，尤其是設計有關數學演算法的問題。
在BigO(1) 做得完的事情, 就沒有必要花費BigO(n) 去做。1-2+3-4+5-6+7......+n看就知道兩組當一項都是-1, 當然是一道簡化的數學式即可算出，根本就不需要使用迴圈去計算。
更例如算費氏數列，絕大多數人都使用遞迴計算，但是n帶很大的時候，效率卻差到不行;但是事實上不論n多少, 是有BigO(1)就計算出來的作法。有規則的東西都幾乎可以用BigO(1)的演算法來計算得到結果，就端看設計者的功力和數學好不好而定。</description>
		<content:encoded><![CDATA[<p>程式設計師本來就必須要想到程式的執行效率，尤其是設計有關數學演算法的問題。<br />
在BigO(1) 做得完的事情, 就沒有必要花費BigO(n) 去做。1-2+3-4+5-6+7&#8230;&#8230;+n看就知道兩組當一項都是-1, 當然是一道簡化的數學式即可算出，根本就不需要使用迴圈去計算。<br />
更例如算費氏數列，絕大多數人都使用遞迴計算，但是n帶很大的時候，效率卻差到不行;但是事實上不論n多少, 是有BigO(1)就計算出來的作法。有規則的東西都幾乎可以用BigO(1)的演算法來計算得到結果，就端看設計者的功力和數學好不好而定。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
