• <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 丑石 閱讀(299) 評論(0)  編輯 收藏 引用 所屬分類: Algorithm and Data Structure

            My Links

            Blog Stats

            News

            常用鏈接

            留言簿(1)

            隨筆分類(13)

            隨筆檔案(17)

            文章檔案(1)

            相冊

            收藏夾(1)

            Friends' blog

            useful sites

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            伊人久久大香线蕉av一区| 成人资源影音先锋久久资源网| 蜜桃麻豆www久久| 精品久久国产一区二区三区香蕉 | 色播久久人人爽人人爽人人片AV| 久久婷婷午色综合夜啪| 久久天天躁狠狠躁夜夜躁2O2O| 久久99精品国产一区二区三区| 亚洲午夜久久久久久久久久| 久久亚洲国产精品一区二区| 三级三级久久三级久久 | 亚洲狠狠久久综合一区77777| 偷窥少妇久久久久久久久| 国产V综合V亚洲欧美久久| 亚洲愉拍99热成人精品热久久| 99久久国产综合精品成人影院| 久久99精品国产麻豆宅宅| 青春久久| 要久久爱在线免费观看| 久久国产高清一区二区三区| 色综合久久无码中文字幕| 欧美日韩精品久久久免费观看| 草草久久久无码国产专区| 国产精品激情综合久久| 久久亚洲AV成人无码国产| 日韩欧美亚洲综合久久| 久久久久黑人强伦姧人妻| 欧美激情精品久久久久久久九九九 | 国产午夜福利精品久久| 奇米影视7777久久精品| 欧美伊人久久大香线蕉综合 | 7777精品伊人久久久大香线蕉| 久久精品国产亚洲一区二区三区 | 四虎影视久久久免费| 国产精品99久久久久久董美香| 亚洲国产精品热久久| 国产精品熟女福利久久AV| 国产亚洲精午夜久久久久久| 国产AⅤ精品一区二区三区久久| 久久国产乱子精品免费女| 久久精品国产精品亚洲|