Chung's Notebook

Recent posts

Mar 10, 2021
Frustration on programming Suppose there are two people, A and B. A known nothing about algorithm. B mastered the book Introduction to Algorithm...
Apr 19, 2019
使用矩陣計算遞歸關係式 最近與朋友討論一條題目:一個 $3 \times n$ 的網格,以 $1 \times 2$ 的磚塊(可旋轉)填滿,有多少種填法? 朋友的解法是動態規劃,我對動態規劃不太熟悉,倒是比較常用遞歸關係,兩者算是殊途同歸。 # 遞歸關係式 ...
Apr 17, 2019
快速排序中分割元素的的另一種寫法 快速排序(Quicksort)由以下幾個部分組成: 1. 選定 `pivot` 2. 移動數組中的元素,使元素以 `pivot` 為界分割成兩部分,前面部分全部小於 `pivot`,後面部分全部大於 `pivot` 3. 遞歸排序前面部...