• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            linux&c++ R&D

            programing is a pleasure!

            Thinking recursively

            First,Let's know the principle:
            Recursive leap of faith-
            When you try to understand a recursive program,you must be able to put the underlying details aside and focus instead on a single level of the operation. At that level,you are allowed to assume that any recursive call automatically gets the right answer as long as the arguments to that call are simpler than the original arguments in some respect.The psychological strategy-assuming that any simpler recursive call will work correctly-is called the recursive leap of faith!
            The idea may be difficult to newers! Take an example for it:
            We all know the Fibonacci function:
            F(n)=F(n-1)+F(n-2)
            Recursive implementation of the Fibonacci funtion:

            int Fib(int n){
            if (n<=1)
               
            return n;
             
            else
               
            return Fib(n-1)+Fib(n-2);
            }

             if n is 5,Fib(5) is computed by the sum of Fib(4) and Fib(3).
            Applying the faith,you can assume that  the program correctly computes each of these values,without going through all the steps that Fib(4) and Fib(3) is computed!

            posted on 2008-03-16 18:54 丑石 閱讀(300) 評論(0)  編輯 收藏 引用 所屬分類: Algorithm and Data Structure

            My Links

            Blog Stats

            News

            常用鏈接

            留言簿(1)

            隨筆分類(13)

            隨筆檔案(17)

            文章檔案(1)

            相冊

            收藏夾(1)

            Friends' blog

            useful sites

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            亚洲午夜精品久久久久久app| 一本久久免费视频| 99久久精品这里只有精品| 久久91亚洲人成电影网站| 91久久九九无码成人网站 | 99久久99久久精品国产| 久久精品国产一区二区三区不卡| 精品人妻伦九区久久AAA片69| 国产精品久久久久影院嫩草 | 久久影院午夜理论片无码| 亚洲精品乱码久久久久久| 国产精品亚洲美女久久久| 久久天天躁狠狠躁夜夜96流白浆 | 亚洲七七久久精品中文国产| 久久久久女人精品毛片| 性做久久久久久久久老女人| 精品久久久久久中文字幕人妻最新 | 国产精品免费看久久久香蕉| 婷婷五月深深久久精品| 久久午夜夜伦鲁鲁片免费无码影视| 久久久精品一区二区三区| 久久99国内精品自在现线| 久久久噜噜噜久久中文字幕色伊伊 | 久久经典免费视频| 99久久精品免费看国产一区二区三区| 久久精品久久久久观看99水蜜桃 | 欧美一区二区三区久久综合| 亚洲另类欧美综合久久图片区| 久久久久综合网久久| 久久ZYZ资源站无码中文动漫| 亚洲国产精品无码成人片久久| 久久人人爽人人精品视频| 久久99精品久久久久久噜噜| 四虎国产精品免费久久久| 久久99热狠狠色精品一区| 97久久超碰国产精品旧版| 久久99热狠狠色精品一区| segui久久国产精品| 久久久久一本毛久久久| 伊人久久成人成综合网222| 国产精品99久久久久久宅男小说|