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

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            久久免费看黄a级毛片| 久久狠狠高潮亚洲精品| 久久久精品日本一区二区三区| 九九久久精品无码专区| 亚洲人成无码www久久久| 精品久久人人爽天天玩人人妻| 久久99精品久久久久久hb无码 | 99久久免费国产精精品| 日本免费一区二区久久人人澡| 一级A毛片免费观看久久精品| 久久综合香蕉国产蜜臀AV| 久久精品国产一区二区电影| 亚洲∧v久久久无码精品| 国产精品99久久久久久宅男 | 久久精品国产亚洲AV香蕉| 99精品伊人久久久大香线蕉| 99久久99久久精品国产片果冻| 久久香蕉国产线看观看99| 一本久久精品一区二区| 99久久精品免费看国产| 久久精品国产亚洲AV嫖农村妇女| 亚洲国产高清精品线久久 | 香蕉久久夜色精品国产小说| 一本色道久久HEZYO无码| 久久毛片免费看一区二区三区| 人人狠狠综合久久亚洲婷婷| 久久人人爽人人爽人人AV| 精品熟女少妇AV免费久久| 色综合久久天天综线观看| 精品久久久久久无码中文野结衣| 久久99国产精一区二区三区| 999久久久无码国产精品| 无码伊人66久久大杳蕉网站谷歌 | 99久久伊人精品综合观看| 国内精品久久久久伊人av | 久久精品视屏| 久久亚洲高清综合| 一本久久免费视频| 久久精品国产清自在天天线| 久久91精品国产91久| 亚洲愉拍99热成人精品热久久|