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

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            97精品伊人久久久大香线蕉| 亚洲AV无码1区2区久久| 久久国产香蕉视频| 伊人久久大香线蕉综合热线| 亚洲精品tv久久久久久久久| 国内精品久久久久| 麻豆av久久av盛宴av| 久久本道伊人久久| 久久天天躁狠狠躁夜夜躁2014| 国产精品美女久久久m| 综合久久一区二区三区| 18岁日韩内射颜射午夜久久成人| 东方aⅴ免费观看久久av| 国产精品免费久久久久电影网| 亚洲精品无码久久久久去q| 久久久久97国产精华液好用吗| 国产午夜免费高清久久影院 | 久久精品不卡| 久久精品国产亚洲麻豆| 色综合久久久久综合体桃花网 | 色综合久久中文综合网| 久久精品国产亚洲av水果派| 中文精品久久久久人妻| 丰满少妇人妻久久久久久4| 国产欧美久久一区二区| 久久久久人妻一区精品色| 久久亚洲熟女cc98cm| 久久国产亚洲精品| 国内精品伊人久久久影院| 一级女性全黄久久生活片免费 | 久久ww精品w免费人成| 亚洲中文字幕久久精品无码喷水| 一97日本道伊人久久综合影院| 久久久久女教师免费一区| 久久久久99精品成人片| 久久综合亚洲色HEZYO国产| 久久久WWW成人免费精品| 久久无码国产| 国产成人精品久久| 久久精品人人做人人爽97| 狠狠色婷婷综合天天久久丁香|