<?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>Comments on: [MMDays專欄] 由樹的前序、中序、後序走法來談資料結構</title>
	<atom:link href="http://mmdays.com/2008/01/19/data_structure_tree/feed/" rel="self" type="application/rss+xml" />
	<link>http://mmdays.com/2008/01/19/data_structure_tree/</link>
	<description>網路, 產業, 資訊, 觀察, 生活, 電影, 技術, 新知, 科技, 媒體, 趨勢, Web 2.0</description>
	<pubDate>Thu, 08 Jan 2009 20:06:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 讚的啦</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-21505</link>
		<dc:creator>讚的啦</dc:creator>
		<pubDate>Fri, 21 Nov 2008 01:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-21505</guid>
		<description>像我這種非資訊出生，卻又是幹IT Coding行業的，一碰到這種比較深入的原理還真的是頭痛到不行，雖然不懂也是無所謂，但就是很想知道為什麼，卻又不可能去拿一本資料結構來K，這一篇就很適合我這種類型讀者的教材。最近深入C#與C++結合時候看到一個教材提這類東西還真像是瞎子在摸象，這篇總看完後就比較有大體的概念啦～～</description>
		<content:encoded><![CDATA[<p>像我這種非資訊出生，卻又是幹IT Coding行業的，一碰到這種比較深入的原理還真的是頭痛到不行，雖然不懂也是無所謂，但就是很想知道為什麼，卻又不可能去拿一本資料結構來K，這一篇就很適合我這種類型讀者的教材。最近深入C#與C++結合時候看到一個教材提這類東西還真像是瞎子在摸象，這篇總看完後就比較有大體的概念啦～～</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; MMDays - Mr. Thursday - Stack堆疊的資料結構</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-16219</link>
		<dc:creator>&#187; MMDays - Mr. Thursday - Stack堆疊的資料結構</dc:creator>
		<pubDate>Wed, 02 Apr 2008 17:41:29 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-16219</guid>
		<description>[...] 因此，之前在〈由樹的前序、中序、後序走法來談資料結構〉裡面提到的前序、中序、後序的走法，也可以透過遞迴加上堆疊的資料結構來完成！譬如說上面這棵樹，我們從樹根7開始，發現有分支就往下走，但是我們先不把樹根忘掉，因此把樹根7 push到堆疊裡面。接者按照同樣的方法，往樹葉的方向走，一直走到樹葉的部分 ，再按照先進後出的順序，把堆疊pop出來的東西印出來，就是後序走訪這棵樹的方式了！ [...]</description>
		<content:encoded><![CDATA[<p>[...] 因此，之前在〈由樹的前序、中序、後序走法來談資料結構〉裡面提到的前序、中序、後序的走法，也可以透過遞迴加上堆疊的資料結構來完成！譬如說上面這棵樹，我們從樹根7開始，發現有分支就往下走，但是我們先不把樹根忘掉，因此把樹根7 push到堆疊裡面。接者按照同樣的方法，往樹葉的方向走，一直走到樹葉的部分 ，再按照先進後出的順序，把堆疊pop出來的東西印出來，就是後序走訪這棵樹的方式了！ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; MMDays - Mr. Thursday - 二元樹在排序的應用</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-15959</link>
		<dc:creator>&#187; MMDays - Mr. Thursday - 二元樹在排序的應用</dc:creator>
		<pubDate>Sat, 15 Mar 2008 17:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-15959</guid>
		<description>[...] 在〈由樹的前序、中序、後序走法來談資料結構〉文章裡面提到了演算法就像是做事情的方法，資料結構則是對應演算法可以運作的東西，譬如說刮鬍子有步驟一、步驟二、步驟三，但是要有刮鬍刀、插頭、以及鬍鬚，那些步驟才有運作的東西，甚至不同的刮鬍刀，也會讓同樣的步驟有不同的執行效率，或是連原來的步驟都要改變，譬如說不是電動刮鬍刀，原來步驟裡面插插頭的那一步，也就可以不用作了。演算法和資料結構之間的關係也是如此，譬如說排序的演算法，可以用不同的資料結構來實現，好的資料結構，可能某一種排序演算法最適合，對其他種排序演算法，可能反而讓速度變慢。 [...]</description>
		<content:encoded><![CDATA[<p>[...] 在〈由樹的前序、中序、後序走法來談資料結構〉文章裡面提到了演算法就像是做事情的方法，資料結構則是對應演算法可以運作的東西，譬如說刮鬍子有步驟一、步驟二、步驟三，但是要有刮鬍刀、插頭、以及鬍鬚，那些步驟才有運作的東西，甚至不同的刮鬍刀，也會讓同樣的步驟有不同的執行效率，或是連原來的步驟都要改變，譬如說不是電動刮鬍刀，原來步驟裡面插插頭的那一步，也就可以不用作了。演算法和資料結構之間的關係也是如此，譬如說排序的演算法，可以用不同的資料結構來實現，好的資料結構，可能某一種排序演算法最適合，對其他種排序演算法，可能反而讓速度變慢。 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Catsondbs</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14843</link>
		<dc:creator>Catsondbs</dc:creator>
		<pubDate>Tue, 22 Jan 2008 15:02:45 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14843</guid>
		<description>話說當初學stack這個結構時是完全的不知所云，既不知道有甚麼用途，也不明白為何要這麼麻煩;
直到後來學用tree來表示加減法時才恍然大悟，還目瞪口呆地佩服一開始想出來的人...

早點看到這麼文章就好啦，對入門者來說真的很簡單易明~</description>
		<content:encoded><![CDATA[<p>話說當初學stack這個結構時是完全的不知所云，既不知道有甚麼用途，也不明白為何要這麼麻煩;<br />
直到後來學用tree來表示加減法時才恍然大悟，還目瞪口呆地佩服一開始想出來的人&#8230;</p>
<p>早點看到這麼文章就好啦，對入門者來說真的很簡單易明~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr. Thursday</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14793</link>
		<dc:creator>Mr. Thursday</dc:creator>
		<pubDate>Mon, 21 Jan 2008 10:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14793</guid>
		<description>謝謝pcbill的補充!</description>
		<content:encoded><![CDATA[<p>謝謝pcbill的補充!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pcbill</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14791</link>
		<dc:creator>pcbill</dc:creator>
		<pubDate>Mon, 21 Jan 2008 06:07:14 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14791</guid>
		<description>補充一下，tree 的特性還有必須要有一個根節點(root note)，還有結構裡不能有 cycle。不然就是圖(graph)了，請參考 http://en.wikipedia.org/wiki/Graph_%28data_structure%29
不過作為入門跨領域的參考文章，我想 Mr. Thursday 已經說得很清楚了。</description>
		<content:encoded><![CDATA[<p>補充一下，tree 的特性還有必須要有一個根節點(root note)，還有結構裡不能有 cycle。不然就是圖(graph)了，請參考 <a href="http://en.wikipedia.org/wiki/Graph_%28data_structure%29" rel="nofollow">http://en.wikipedia.org/wiki/Graph_%28data_structure%29</a><br />
不過作為入門跨領域的參考文章，我想 Mr. Thursday 已經說得很清楚了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr. Thursday</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14780</link>
		<dc:creator>Mr. Thursday</dc:creator>
		<pubDate>Sun, 20 Jan 2008 16:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14780</guid>
		<description>希望這篇文章能夠有所幫助!</description>
		<content:encoded><![CDATA[<p>希望這篇文章能夠有所幫助!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sntw</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14774</link>
		<dc:creator>sntw</dc:creator>
		<pubDate>Sun, 20 Jan 2008 14:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14774</guid>
		<description>哇，真是謝謝各位解惑，我還以為以格主的發文速度，這篇會沉下去呢！</description>
		<content:encoded><![CDATA[<p>哇，真是謝謝各位解惑，我還以為以格主的發文速度，這篇會沉下去呢！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr. Thursday</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14773</link>
		<dc:creator>Mr. Thursday</dc:creator>
		<pubDate>Sun, 20 Jan 2008 14:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14773</guid>
		<description>有機會再另外寫一篇文章介紹stack(堆疊)這個資料結構
就比較容易看懂了 ^^</description>
		<content:encoded><![CDATA[<p>有機會再另外寫一篇文章介紹stack(堆疊)這個資料結構<br />
就比較容易看懂了 ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr. Thursday</title>
		<link>http://mmdays.com/2008/01/19/data_structure_tree/comment-page-1/#comment-14772</link>
		<dc:creator>Mr. Thursday</dc:creator>
		<pubDate>Sun, 20 Jan 2008 14:54:24 +0000</pubDate>
		<guid isPermaLink="false">http://mmdays.com/2008/01/19/data_structure_tree/#comment-14772</guid>
		<description>一開始先把pre-order的expression的三項東西push到stack裡面
然後進行下面的步驟
(1) pop出三項東西，如果剛好是 運算子 接著 兩個運算元 則執行步驟(2) 否則執行步驟(3)
(2) 把這兩個運算元 依照運算子運算之後 push回stack裡面, 跳到步驟(4)
(3) 把步驟(1)pop出來的三項東西push回去, 繼續步驟(4)
(4) 如果stack裡面只剩下一個數字 就是答案, 
否則繼續push expression裡面的下一個東西 然後重覆步驟(1)

依照這個方法 運算(1+2)*(3+4)的pre-order expression
* + 1 2 + 3 4

round 0:
STACK: (empty)
EQ: * + 1 2 + 3 4
round 1:
STACK: * + 1
EQ: 2 + 3 4
round 2:
STACK: * + 1 2
EQ: + 3 4
round 3:
STACK: * 3
EQ: + 3 4
round 4:
STACK: * 3 +
EQ: 3 4
round 5:
STACK: * 3 + 3
EQ: 4
round 6:
STACK: * 3 + 3 4
EQ: (empty)
round 7:
STACK: * 3 7
EQ: (empty)
round 8:
STACK: 21  (answer!)
EQ: (empty)</description>
		<content:encoded><![CDATA[<p>一開始先把pre-order的expression的三項東西push到stack裡面<br />
然後進行下面的步驟<br />
(1) pop出三項東西，如果剛好是 運算子 接著 兩個運算元 則執行步驟(2) 否則執行步驟(3)<br />
(2) 把這兩個運算元 依照運算子運算之後 push回stack裡面, 跳到步驟(4)<br />
(3) 把步驟(1)pop出來的三項東西push回去, 繼續步驟(4)<br />
(4) 如果stack裡面只剩下一個數字 就是答案,<br />
否則繼續push expression裡面的下一個東西 然後重覆步驟(1)</p>
<p>依照這個方法 運算(1+2)*(3+4)的pre-order expression<br />
* + 1 2 + 3 4</p>
<p>round 0:<br />
STACK: (empty)<br />
EQ: * + 1 2 + 3 4<br />
round 1:<br />
STACK: * + 1<br />
EQ: 2 + 3 4<br />
round 2:<br />
STACK: * + 1 2<br />
EQ: + 3 4<br />
round 3:<br />
STACK: * 3<br />
EQ: + 3 4<br />
round 4:<br />
STACK: * 3 +<br />
EQ: 3 4<br />
round 5:<br />
STACK: * 3 + 3<br />
EQ: 4<br />
round 6:<br />
STACK: * 3 + 3 4<br />
EQ: (empty)<br />
round 7:<br />
STACK: * 3 7<br />
EQ: (empty)<br />
round 8:<br />
STACK: 21  (answer!)<br />
EQ: (empty)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
