Algorithms
Introduction
1.
Binary Search
2.
Tree
2.1.
Tree Traversal
3.
Dynamic Programming
3.1.
坐标型
3.2.
单序列型
3.3.
双序列型
3.4.
划分区间类
3.5.
博弈类
3.6.
区间类
3.7.
背包类
3.8.
Misc
4.
Backtracking
5.
Graph
5.1.
Breadth First Search
5.2.
Depth First Search
5.3.
Topological Sort
Powered by
GitBook
Algorithms
划分区间类
state
: f[i] 表示前 i 个元素的最大/小 值
function
: f[i] = 前 i 个元素里面选一个区间的最值
题目
53. Maximum Subarray
152. Maximum Product Subarray
121. Best Time to Buy and Sell Stock
309. Best Time to Buy and Sell Stock with Cooldown
123. Best Time to Buy and Sell Stock III
188. Best Time to Buy and Sell Stock IV