Files
Learn-Algorithms/8 Algorithms Analysis/动态规划.md
T
2021-03-18 21:24:06 +08:00

35 lines
779 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 动态规划DP
复杂问题不能分解成几个子问题,而分解成一系列子问题;
DP通常基于一个递推公式及一个(或多个)初始状态,当前子问题解由上一次子问题解推出。
状态
状态转移方程
递推关系
动态规划算法的关键在于解决冗余,以空间换时间的技术,需要存储过程中的各种状态。可以看着是`分治算法`+`解决冗余`
使用动态规划算法的问题的特征是`子问题的重叠性`,否则动态规划算法不具备优势
####基本步骤
1. 划分问题
2. 选择状态
3. 确定决策并写出状态转移方程
4. 写出规划方程
#### 最长递增子序列
最长递增子序列(LIS Longest Increasing Subsequence)
#### 其它案例
最短路径