4 ms·
What is a good example of recursion other than generating a Fibonacci sequence?
- motxilo 16y agoI personally consider generating Fibonacci sequences a spiffy example of recursion since due to its tree-recursive nature, one step further on top of linear processes generated by factorial-like implementations. For instance, this very fact can be used to study exponential time complexities and serves as an introduction to important concepts like memoization.