zoukankan      html  css  js  c++  java
  • Recursive functions and algorithms

    http://en.wikipedia.org/wiki/Recursion_(computer_science)#Recursive_functions_and_algorithms

    A common computer programming tactic is to divide a problem into sub-problems of the same type as the original, solve those sub-problems, and combine the results. This is often referred to as the divide-and-conquer method; when combined with a lookup tablethat stores the results of solving sub-problems (to avoid solving them repeatedly and incurring extra computation time), it can be referred to as dynamic programming or memoization.

    A recursive function definition has one or more base cases, meaning input(s) for which the function produces a result trivially(without recurring), and one or more recursive cases, meaning input(s) for which the program recurs (calls itself). For example, the factorial function can be defined recursively by the equations 0! = 1 and, for all n > 0n! = n(n − 1)!. Neither equation by itself constitutes a complete definition; the first is the base case, and the second is the recursive case. Because the base case breaks the chain of recursion, it is sometimes also called the "terminating case".

  • 相关阅读:
    负数幅角的选取
    记一次py交易
    区间估计
    平方和
    正态总体 下常用结论
    每日一背
    乘积的期望
    java调用javascript
    Java Agent入门
    JavaPoet入门
  • 原文地址:https://www.cnblogs.com/forcheryl/p/3785374.html
Copyright © 2011-2022 走看看