<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MurkyPig on Medium]]></title>
        <description><![CDATA[Stories by MurkyPig on Medium]]></description>
        <link>https://medium.com/@dylanchengtn?source=rss-4953e4dd59c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XVOj0iCXzVA7xelE9RbSdA.jpeg</url>
            <title>Stories by MurkyPig on Medium</title>
            <link>https://medium.com/@dylanchengtn?source=rss-4953e4dd59c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:51:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dylanchengtn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[KMP(knuth-morris-pratt)]]></title>
            <link>https://medium.com/@dylanchengtn/kmp-knuth-morris-pratt-2cb7722e7406?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cb7722e7406</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 08:11:28 GMT</pubDate>
            <atom:updated>2019-02-20T08:11:28.006Z</atom:updated>
            <content:encoded><![CDATA[<p>dynamic programming</p><p>由MP延伸出來</p><p><strong>MP時間複雜度O(mn)</strong></p><p><strong>KMP時間複雜度O(m+n)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-lY_yrdY1HpY7K2nwtzN0A.png" /></figure><ul><li>*index 從0開始 → -1</li><li>*index從1開始 → 0</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cb7722e7406" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strassen’s Matrix Multiplication]]></title>
            <link>https://medium.com/@dylanchengtn/strassens-matrix-multiplication-85ec3c80174c?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/85ec3c80174c</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 08:11:15 GMT</pubDate>
            <atom:updated>2019-02-20T08:11:15.822Z</atom:updated>
            <content:encoded><![CDATA[<p>divide &amp; conquer</p><p>一個矩陣可以分解成這樣，就是divide &amp; conquer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*3eavmNxdIhwwrSQm6DjEdw.png" /></figure><p>不知道哪個數學大師，這麼厲害，想出這樣神奇的方法</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*06uiAd2LFKaLPf7RG8W4kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*F-6ITzHSxiI97mZxjm_-1g.png" /></figure><p>所以只要切成七個方程式就可以找到解</p><p>時間複雜度如下</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*sjsMznhhWGIUnKwN9KmtOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*VJa2qif5ZAxUTSLEm7d84g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85ec3c80174c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Matrix Chain Multiplication]]></title>
            <link>https://medium.com/@dylanchengtn/matrix-chain-multiplication-b4ae01007d1b?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4ae01007d1b</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 08:11:04 GMT</pubDate>
            <atom:updated>2019-02-20T08:11:04.083Z</atom:updated>
            <content:encoded><![CDATA[<p>Dynamic Programming</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*6A93GNte1j_TS8SEAvrZOQ.png" /></figure><p>公式:</p><p>m[i,j]=min{m[i,k]+m[k,j]+d(i-1)*d(k)*d(j)}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*wk8m_Jbhd5T2Uw0Wr88XcA.png" /></figure><p>時間複雜度:O(N^3)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4ae01007d1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Longest common Subsequence]]></title>
            <link>https://medium.com/@dylanchengtn/longest-common-subsequence-249d15074dd2?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/249d15074dd2</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 08:10:52 GMT</pubDate>
            <atom:updated>2019-02-20T08:10:52.283Z</atom:updated>
            <content:encoded><![CDATA[<p>dynamic programming</p><p>時間複雜度: O(mn)</p><p>Str1: stone</p><p>Str2: longest</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*tBO9U1oJyXKk77hb5b2TOQ.png" /></figure><pre>if(A[i]= B[j])</pre><pre>   LCS[i,j] = 1 + LCS[i+1,j-1]</pre><pre>else</pre><pre>   LCS[i,j]=max(LCS[i+1,j],LCS[i,j-1])</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=249d15074dd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[0/1 Knapsack Problem]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/0-1-knapsack-problem-dc19f479577?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc19f479577</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 15:11:29 GMT</pubDate>
            <atom:updated>2019-02-18T15:11:29.624Z</atom:updated>
            <content:encoded><![CDATA[<p>Dynamic Programming</p><p>Tabulation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*hGIBE67KKX4rjbj-MsDM8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iv5ZqdntPKh7_ugXbHE_vg.png" /></figure><p>時間複雜度: O(nW)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc19f479577" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/0-1-knapsack-problem-dc19f479577">0/1 Knapsack Problem</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Knapsack Problem]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/knapsack-problem-f909c6f7af82?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f909c6f7af82</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 14:52:28 GMT</pubDate>
            <atom:updated>2019-02-18T14:52:28.442Z</atom:updated>
            <content:encoded><![CDATA[<p>greedy</p><p>。fraction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*CW2e0hPlUHGyryWV4WXqrQ.png" /></figure><p>Constraint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*UQqM8hb2RbIJsJllPSrjbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*8X9P8dIPy208YIjLZYYRDA.png" /></figure><p>Objective</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/176/1*JV9FmtOzPl9SXtA0fCuk1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*_oTR1va2JGX0eYiBQGndsg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f909c6f7af82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/knapsack-problem-f909c6f7af82">Knapsack Problem</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TSP(Traveling Salesman Problem)]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/tsp-traveling-salesman-problem-4caeea5f1343?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4caeea5f1343</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 14:37:42 GMT</pubDate>
            <atom:updated>2019-02-18T14:37:42.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Backtracking or Dynamic programming</p><p>經典例子，周遊各國的商人，想去所有不同的地方買賣東西，求最短路徑</p><p>→判斷是否存在H.C.且 weight min (NP-hard)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*X9RY4OggCxB8Xk__Ma8G5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bp2HK4e2Qv1XOZebwziVaQ.png" /></figure><p>時間複雜度:</p><ol><li>Backtracking :O(v!) = O(n^n)</li><li>Dynamic programming : O(2^n)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4caeea5f1343" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/tsp-traveling-salesman-problem-4caeea5f1343">TSP(Traveling Salesman Problem)</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hamiltonian cycles]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/hamiltonian-cycles-aab3f8750b9e?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab3f8750b9e</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 14:04:50 GMT</pubDate>
            <atom:updated>2019-02-18T14:04:50.385Z</atom:updated>
            <content:encoded><![CDATA[<p>back track method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*z9l_eduS8QVcS5MRlkbDbg.png" /></figure><pre>##backtrack tech<br>1,2,3,4,5,6,1<br>1,2,6,5,4,3,1<br>1,6,2,5,4,3,1<br>2,3,4,5,6,1,2(跟第一列相同)</pre><p>ex:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*x00cnnuuPsa3PdgfFLLinw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ga6zoqhcsIX3Vg_SVl9PWQ.png" /></figure><p>時間複雜度: O(N!)=O(N^N)</p><p>pseudo code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*VnwFZ-zOh-iHXfPipUssIg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab3f8750b9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/hamiltonian-cycles-aab3f8750b9e">Hamiltonian cycles</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Huffman Algo]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/huffman-algo-1121294a87d1?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1121294a87d1</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 13:28:49 GMT</pubDate>
            <atom:updated>2019-02-18T13:28:49.863Z</atom:updated>
            <content:encoded><![CDATA[<p>greedy</p><p>有一message → BCCABBDDAECCBBAEDDCC</p><p>建個表紀錄</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*3Yi1WPBLCZXsNuFsU2l-9A.png" /></figure><p>再透過表畫出，WEPL TREE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*YHrE4-AqVGsmZUvZQzF7aw.png" /></figure><p>pseudo code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*Lr1jpJyMPZpK6EdzKZTOBw.png" /></figure><p>時間複雜度:O(nlogn)</p><p>建立Queue: O(n)</p><p>Priority Queue 均為 O(log n) for (n-1) 次</p><p>則 O(NlogN)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1121294a87d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/huffman-algo-1121294a87d1">Huffman Algo</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Floyd -Warshall]]></title>
            <link>https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/floyd-warshall-69a94d9234eb?source=rss-4953e4dd59c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/69a94d9234eb</guid>
            <dc:creator><![CDATA[MurkyPig]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 13:05:55 GMT</pubDate>
            <atom:updated>2019-02-18T13:05:55.476Z</atom:updated>
            <content:encoded><![CDATA[<p>Dynamic programming</p><p>All pairs shortest path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*t8Zyq-nL4K7c6F0rQYvfyQ.png" /></figure><p>把這個圖記錄在矩陣中</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*UVAUBB47lRDPVOoNob3wKQ.png" /></figure><p>開始run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*ccU1XehyM272tW6jh6rgEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*vgsgTUb48q3Cj-Z9HAdFbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*BRwkb2S3m8XT7kX50XMnNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*sMcU0YR9RYtAO3kZDyjObA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*Aih3mWRk_DJkCa1a1n-y_g.png" /></figure><p>最後一個矩陣就是所有點到任一個點的最短路徑</p><p>看一下Code吧</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*2ux7XoJVZCYqvDRX1wogTw.png" /></figure><p>時間複雜度:O(V*V*V)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69a94d9234eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27/floyd-warshall-69a94d9234eb">Floyd -Warshall</a> was originally published in <a href="https://medium.com/%E6%B8%AC%E8%A9%A6%E7%94%A8kk27">翛然野叟</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>