减治法Decrease and Conquer
*Exploring the relationship between a solution to a given instance of (e.g., P(n) )a problem and a solution to a smaller instance (e.g., P(n/2) or P(n-1) )of the same problem.
*Use top down(recursive) or bottom up (iterative) to solve the problem.
*Use top down(recursive) or bottom up (iterative) to solve the problem.
减治法举例Examples of Decrease and Conquer
Decrease by a constant:the size of the problem is reduced by the same constant on each iteration/recursion of the algorithm.
减去一个常量
Insertion sort
Graph search algorithms:
DFS
BFS
Algorithms for generating permutations, subsets
Insertion sort
Graph search algorithms:
DFS
BFS
Algorithms for generating permutations, subsets
Decrease by a constant factor:the size of the problem is reduced by the same constant factor on each iteration/recursion of the algorithm.
减去一个常量因子
Binary search
Fake-coin problems
Binary search
Fake-coin problems