leetcode

神奇的演算法 - Binary Search 到底怎麼寫才會對?

category: algorithm     4 minute read     Posted on:

Introduction to Binary Search 如果說,要在一串排序過後的陣列中,找尋特定的數值,二元搜尋絕對是最快的存在 憑藉著一次可以排除一半的可能性,使得二元搜尋的複雜度為 O(log n)

神奇的演算法 - Greedy Algorithm

category: algorithm     2 minute read     Posted on:

Preface 還記得之前上演算法的時候,最看不懂的東西就是貪婪法了 不過其實他的核心概念很簡單,寫起來也簡單 趁著還記得細節的時候,把它紀錄起來

神奇的演算法 - Monotonic Stack

category: algorithm     3 minute read     Posted on:

Preface 千言萬語都比不上一個真實的範例