3 ms·
Loops are also infinite loops waiting to happen, yet we still use them :) The reason one might want to use recursion is when you're working on a data structure
by yen223 7y ago
Loops are also infinite loops waiting to happen, yet we still use them :)
The reason one might want to use recursion is when you're working on a data structure that is recursive in shape, like trees. And trees are very common, the Hacker News comments are one such example.