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

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            久久久精品国产免大香伊| 久久发布国产伦子伦精品| 久久精品无码一区二区日韩AV| 国产精品无码久久久久 | 一本色综合久久| 久久亚洲精品成人av无码网站| 国产Av激情久久无码天堂| 国产精品女同一区二区久久| 国产亚洲美女精品久久久2020| 久久久久99精品成人片欧美 | 色8久久人人97超碰香蕉987| 99久久婷婷国产综合精品草原| 亚洲国产精品无码久久九九| 久久水蜜桃亚洲av无码精品麻豆 | 国产一级做a爰片久久毛片| 手机看片久久高清国产日韩| 久久精品国产一区| 久久婷婷五月综合97色直播| 久久99久久无码毛片一区二区| 性欧美大战久久久久久久久| 国产视频久久| 久久精品国产半推半就| 久久婷婷国产综合精品 | 97精品国产97久久久久久免费| 亚洲午夜久久久影院| 久久只有这里有精品4| 中文字幕久久欲求不满| 人人狠狠综合久久亚洲婷婷| 久久久久无码精品国产| 久久综合给合久久狠狠狠97色69| 色悠久久久久久久综合网| 99久久精品久久久久久清纯| 久久99国产精品二区不卡| 久久九九精品99国产精品| 午夜人妻久久久久久久久| 久久久久亚洲AV无码专区首JN| 久久综合久久综合亚洲| 99久久国产宗和精品1上映| 久久精品中文无码资源站| 伊人久久大香线蕉综合Av| 亚洲va久久久噜噜噜久久狠狠|