• <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

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            热99RE久久精品这里都是精品免费 | 久久久久婷婷| 国产精久久一区二区三区| 91超碰碰碰碰久久久久久综合| 色综合合久久天天综合绕视看| 久久久噜噜噜久久| 久久综合给合久久国产免费| 久久久久久久综合日本亚洲| AAA级久久久精品无码区| 色综合久久中文字幕综合网| 狠狠色丁香婷婷综合久久来| 一级A毛片免费观看久久精品| 亚洲成人精品久久| 亚洲欧美精品一区久久中文字幕| 久久人做人爽一区二区三区 | 久久久久亚洲av成人网人人软件 | 亚洲欧美日韩中文久久| 亚洲欧美日韩中文久久| 国产一区二区三区久久| 久久青青草视频| 精品无码久久久久久久久久| 久久国产色AV免费看| 久久久久久久波多野结衣高潮 | 久久人人爽人人爽人人片AV东京热| 久久精品国产亚洲av影院| 久久se精品一区二区影院| 国产精品免费看久久久| 狠狠色狠狠色综合久久| 精品久久久久久国产三级| 亚洲精品乱码久久久久久| 中文字幕精品久久久久人妻| 青青热久久综合网伊人| 少妇久久久久久久久久| 国产偷久久久精品专区 | 国产午夜福利精品久久| 午夜天堂精品久久久久| 久久综合亚洲色一区二区三区| 久久久久无码中| 欧洲国产伦久久久久久久| 久久精品国产精品亚洲下载| 国产精品欧美久久久久无广告|