Difference between Recursion and Iteration

Difference between Recursion and Iteration

1) Recursive function – is a function that is partially defined by itself whereas Iterative functions – are loop based imperative repetitions of a process

Recursion Uses selection structure whereas Iteration uses repitation structure

An infinite loop occurs with iteration if the loop-continuation test never becomes false whereas infinite recursion occurs if the recursion step does not reduce the problem in a manner that converges on the base case.

Iteration terminates when the loop-continuation condition fails whereas recursion terminates when a base case is recognized

When using recursion multiple activation records are created on stack for each call when in iteration everything is done in one activation record
6) Recursion is usually slower then iteration due to overhead of maintaining stack whereas iteration does not use stack so it’s faster than recursion
7) Recursion uses more memory than iteration
8) Infinite recursion can crash the system whereas infinite looping uses cpu
cycles repeatedly

9) Recursion makes code smaller and iteration makes code longer


Source: http://malhar2010.blogspot.in/2010/12/difference-between-recursion-and.html

You can leave a response, or trackback from your own site.

18 Responses to “Difference between Recursion and Iteration”

  1. tutu skirts says:

    Hi! Someone in my Myspace group shared this site with us so I came to look it over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Great blog and fantastic design.

  2. best bridesmaid dresses blog says:

    I got into this article which surprises me since this isn¡¯t one of my interests. You did such a good job of presenting your facts that I couldn¡¯t stop reading.

  3. Retta Zechiel says:

    It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates and will talk about this blog with my Facebook group. Talk soon!

  4. Kimberely Luka says:

    We love our Kindle Fire, but as many people have said it has some drawbacks when compared to the iPad, especially on size and power. But I’m impressed with the new specs of the Kindle Fire 2 with the 10inch screen. Some of the new specs are at kindlemad.com and I think they will be opening up pre-orders soon.

  5. Chadwick Gaeta says:

    Very good article. And just to be on-topic with this post, I don’t know for you girls but for me hair is the most important factor for my look. My hair stilist on the saloon where I go offered me for about 2 months ago some kind of hair oil that makes my hair grow faster and thicker. I don’t like to spam this blog so, who wants to find more details can click on my user name.Also my apologies for my bad english :)

  6. Kristine Jesenovec says:

    I’m a extended time watcher and I just thought I’d drop by and say hi there there for the quite initial time.

  7. huskies says:

    salutations from across the sea. excellent blog I shall return for more.

  8. zkjhpldfob says:

    divounjlv{f, awnorctpar

  9. nootropics says:

    Really great info can be found on this website.

  10. bridal jewelry says:

    I also need to buy a dress’s a I Purchase of high quality wedding, your content, I really like post.

  11. aion kinah says:

    salutations admire your work take a look of mine

  12. time warner san antonio says:

    I have to express thanks to the writer just for rescuing me from this particular trouble. Right after exploring through the internet and coming across notions that were not productive, I thought my entire life was done. Existing minus the solutions to the difficulties you’ve resolved by way of your entire review is a crucial case, as well as ones that might have in a negative way affected my entire career if I had not noticed your site. Your personal capability and kindness in playing with all the stuff was helpful. I’m not sure what I would have done if I had not encountered such a step like this. I am able to now look ahead to my future. Thanks a lot very much for your impressive and effective help. I will not think twice to suggest the sites to anybody who requires tips about this issue.

  13. Graphic Design Belfast says:

    Very interesting information!Perfect just what I was searching for!

  14. Julieann Nahmias says:

    to find issues to further improve my site!I suppose its alright to help make utilization of a few of the principles!!…

  15. Julieann Nahmias says:

    The Birch of the Shadow…

    I think there may well be considered a number of duplicates, but an exceedingly handy list! I have tweeted this. A lot of thanks for sharing!…

  16. X Congreso Toros de Lidia says:

    muy buenos dias acabo de enterarme de tu pagina web y la verdad es que me parece genial no sabia de mas personas interesadas en estos temas, aqui tienes un nuevo lector que seguira visitandote mensualmente.

    Spanish to English:
    “very good morning I just found your website and the truth is that I feel great but did not know of anyone interested in these issues, here’s a new reader who will continue visiting you monthly.”

Leave a Reply

Designed for Ares Galaxy in Collaboration with Hostgator coupons and Popular Wordpress Themes and unlock iphone 5