|
|
|
|
|
by mannykannot
2913 days ago
|
|
If you are dealing with something other than a sequence, such as a tree or a more general network, recursion is often the more insightful way to think about a solution. Actually, the simplest example I can think of where this the case involves a sequence: binary search. On the other hand, if you have to significantly rework the conceptual recursive solution to put it in tail-recursive form, an implementation using loops may end up being easier to understand. |
|