What is a potential risk of using recursion? 

  • Always faster than loops. 
  • Cannot handle large input data. 
  • Guarantees better readability. 
  • Uses less memory than loops.
One of the potential risks of using recursion is that it can lead to excessive memory use, especially when dealing with large input data. Every recursive call adds a new layer to the system's call stack, which can eventually result in a stack overflow if unchecked.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *