• <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无码久久久久久不卡网站 | 久久天堂AV综合合色蜜桃网| 亚洲精品乱码久久久久久中文字幕 | 久久青青草原国产精品免费| 久久国产午夜精品一区二区三区| 久久国产乱子伦精品免费午夜| 模特私拍国产精品久久| 精品久久久久久久久午夜福利| 91超碰碰碰碰久久久久久综合| 伊人久久大香线蕉精品不卡| 久久久久人妻一区精品性色av| 久久国产香蕉一区精品| 久久久av波多野一区二区| 久久成人18免费网站| 久久精品国产亚洲77777| 日本加勒比久久精品| 99国产欧美精品久久久蜜芽| 人妻无码精品久久亚瑟影视| 伊人久久综合热线大杳蕉下载| 亚洲中文字幕无码久久综合网| 欧美粉嫩小泬久久久久久久 | 国内精品九九久久精品| 久久电影网| 国产精品成人久久久久三级午夜电影| 亚洲AV无一区二区三区久久| 久久久久亚洲精品无码网址| 亚洲国产精品久久久久久| 久久婷婷五月综合97色| 97久久国产露脸精品国产| 无码8090精品久久一区| 久久久久久久国产免费看| 中文字幕久久欲求不满| 国产精品久久国产精麻豆99网站| 伊人久久无码中文字幕| 国产成人久久精品一区二区三区 | 久久99精品久久久久子伦| 久久精品国产久精国产一老狼| 久久人人爽人人人人片av| 99久久精品免费看国产一区二区三区| 亚洲人成无码久久电影网站| 国产精品久久久久久久久软件|