DEV Community

Discussion on: How to Replace Loops using Recursion

Collapse
 
wireless90 profile image
wireless90

Its easier to think recursively for harder problems. Like tower of hanoi or solving sudoku.

Collapse
 
cariehl profile image
Cooper Riehl

Notably, this varies from person to person. Some people think more effectively in terms of recursion, while others find it easier to use iteration. Neither one is inherently wrong, they just have pros and cons to be aware of.

Thread Thread
 
theowlsden profile image
Shaquil Maria

Aight aight, thanks for clarifying it for me. When I was starting with Java, we touched based on recursion and I use it from time to time, but I forgot if originally it had an effect on complexity and execution.