分治
Divide a problem to smaller problems to solve. This need some conditions :
- when the problem is divided to be small enough, it can be solved (if k<N)
- the problems have the same structure to solve (recursive )
- the smaller problems are independent
- the solutions of the smaller problems can combine to be the solution of the bigger ones
(1)二分搜索 binary search
(2)大整数乘法 big integer multiply option
(3)Strassen矩阵乘法 matrix multiply (https://en.wikipedia.org/wiki/Strassen_algorithm)
(4)棋盘覆盖 chess board coveration
(5)合并排序 merge sort
(6)快速排序 fast sort
(7)线性时间选择 linear time choice
(8)最接近点对问题 find most near point
(9)循环赛日程表 Round robin schedule
(10)汉诺塔 Hanoi tower
when diside to use divide and conquer algo :
- find the solution for the smallest problem k=0,1..
- find the relation of the last solution to the bigger ones
- program : recursive
No comments:
Post a Comment