• <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 丑石 閱讀(293) 評(píng)論(0)  編輯 收藏 引用 所屬分類: Algorithm and Data Structure


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            My Links

            Blog Stats

            News

            常用鏈接

            留言簿(1)

            隨筆分類(13)

            隨筆檔案(17)

            文章檔案(1)

            相冊(cè)

            收藏夾(1)

            Friends' blog

            useful sites

            搜索

            積分與排名

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久久久噜噜噜亚洲熟女综合| 亚洲精品国产第一综合99久久| 国产亚洲欧美精品久久久| 久久精品国产亚洲网站| 国产精品成人无码久久久久久| 久久婷婷人人澡人人| 麻豆久久久9性大片| 久久婷婷五月综合成人D啪| 久久久久久夜精品精品免费啦| 四虎国产永久免费久久| 97精品伊人久久大香线蕉| 91精品免费久久久久久久久| 久久伊人色| 久久久久久综合一区中文字幕| 久久久久久久综合日本| 国内精品久久久久| 无码专区久久综合久中文字幕 | 亚洲综合精品香蕉久久网97| 欧美日韩中文字幕久久久不卡| 97精品久久天干天天天按摩| 少妇无套内谢久久久久| 国产日韩欧美久久| 狠狠干狠狠久久| 国产亚洲精久久久久久无码| 久久人人爽人人爽人人片av麻烦| 韩国三级中文字幕hd久久精品| 久久精品国产精品亚洲毛片| 久久久久久久精品妇女99| 久久人人爽人人澡人人高潮AV| 久久久久久久综合日本亚洲| 精品国产乱码久久久久久1区2区 | 久久香蕉一级毛片| 久久精品国产网红主播| 国色天香久久久久久久小说| 欧美午夜A∨大片久久 | 亚洲国产成人久久精品影视| 久久久精品国产sm调教网站| 久久丫精品国产亚洲av不卡| 婷婷五月深深久久精品| 天天躁日日躁狠狠久久| 久久天天躁狠狠躁夜夜avapp|