Difference:
First, the roles are different
1, greedy algorithm: synthesize the local optimal solution of the subproblem into a solution of the original solution problem.
2. Recursive algorithm: use recursive algorithm to solve problems. For example, the Hanoi issue; The structure of data is defined recursively. Such as binary tree, generalized table, etc.
3. Dynamic programming: Dynamic programming algorithms are usually used to solve problems with some optimal properties.
4. Divide and conquer algorithm: We can divide them into several smaller subproblems, and so on until we find the solution directly.
Second, the methods are different.
1, greedy algorithm: when solving problems, always make the best choice at present. In other words, the algorithm obtains a local optimal solution in a sense without considering the global optimization.
2. Recursive algorithm: Solve the problem by repeatedly decomposing the problem into similar subproblems.
3. Dynamic planning: divide the process into several interrelated stages, and each stage needs to make decisions to make the whole process achieve the best activity effect.
4. Divide-and-conquer algorithm: A problem of scale n is decomposed into k smaller subproblems.
Third, the characteristics are different.
1, greedy algorithm: choose a measure according to the meaning of the question.
2. Recursive algorithm: Recursion means calling yourself in a procedure or function.
3. Dynamic programming: Although dynamic programming is mainly used to solve the optimization problem of dynamic process with time division, some static programming unrelated to time (such as linear programming and nonlinear programming) can be easily solved by dynamic programming method as long as the time factor is artificially introduced and regarded as a multi-stage decision-making process.
4. Divide and conquer algorithm: the original problem can be decomposed into multiple sub-problems; In the decomposition process of the original problem, the sub-problem is solved recursively; After solving and getting the solution of each subproblem.