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

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            深夜久久AAAAA级毛片免费看| 久久99热这里只频精品6| 亚洲国产精品无码久久久秋霞2 | 人妻精品久久久久中文字幕| 欧美麻豆久久久久久中文| 久久久久无码精品| 亚洲精品美女久久久久99| 国产成年无码久久久久毛片| 久久综合九色综合久99| 一本色综合久久| 久久国产亚洲精品无码| 久久久久一级精品亚洲国产成人综合AV区| 久久久久久无码国产精品中文字幕 | 91久久婷婷国产综合精品青草 | 久久久久99精品成人片牛牛影视 | 久久99国产精品二区不卡| 欧美性大战久久久久久| 久久精品国产亚洲av麻豆色欲 | 久久亚洲精品中文字幕三区| 亚洲精品视频久久久| A级毛片无码久久精品免费| 一本久久a久久精品vr综合| 国产激情久久久久影院| 91精品国产高清91久久久久久| 久久99久国产麻精品66| 一级做a爰片久久毛片看看| 久久综合狠狠综合久久激情 | 国产精品一区二区久久| 色欲综合久久中文字幕网| 久久久久久久波多野结衣高潮| 久久亚洲国产成人影院网站| 精品乱码久久久久久夜夜嗨 | 综合久久给合久久狠狠狠97色| 国产99久久久久久免费看| 国产午夜精品理论片久久影视| 久久精品国产亚洲AV无码麻豆| 久久婷婷五月综合97色| 久久棈精品久久久久久噜噜| 久久精品黄AA片一区二区三区| 久久精品国产亚洲av麻豆小说 | 99久久国产综合精品五月天喷水|