DivideAndConquer
1. Recursion
首先,BF数量级别就是n, n-1, n-2, ….
DivideAndConquer数量级别是n, n/2, n/4, …
本质上,Recursion就是循环,不过不同的就是需要用辅助数组加for循环的结构来替换Recursion。
1 |
Recursion(a, b) |
2. DivideAndConquer
1 |
The general pattern |
Max-Sum
1 |
|
首先,BF数量级别就是n, n-1, n-2, ….
DivideAndConquer数量级别是n, n/2, n/4, …
本质上,Recursion就是循环,不过不同的就是需要用辅助数组加for循环的结构来替换Recursion。
1 |
Recursion(a, b) |
1 |
The general pattern |
Max-Sum
1 |
|
近期评论