I Recursion leads to elegant solutions less code less need for local variables

I recursion leads to elegant solutions less code less

This preview shows page 52 - 53 out of 53 pages.

I Recursion leads to elegant solutions: less code, less need for local variables, etc I If we can define a function mathematically, the solution is easy to implement. Doan Nhat Quang Recursion 37 / 38
Image of page 52
Recursion Conclusion However I Once implemented, it is often very difficult to debug a recursive program. I When reading recursive code, it is sometimes hard to really see how it solves the problem. I Recursive functions are useful for many cases but we should be careful of using recursion I Memory complexity: many function calls, and variable creation I Time complexity: many computations. Doan Nhat Quang Recursion 38 / 38
Image of page 53

You've reached the end of your free preview.

Want to read all 53 pages?

  • Spring '18
  • DK Daniels
  • Recursion, Doan Nhat Quang

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes