Given a choice, would you choose an iterative approach or a recursive one?

View original thread
Sébastien Portebois's photo

To add more about

Avoid heap memory allocation

It also helps to know your language/compiler: if it supports tail call optimization, then you can do recursive call and avoid the memory footprint you would usually get from many recursive calls