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

View other answers to this thread

Learn Something New Everyday,
Connect With The Best Developers!

& 500k+ others use Hashnode actively.

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

Want to read more?

Browse featured discussions

© 2020 · Hashnode