3 ms·
Recursion isn't strictly worse though, due to TCE. And if you can manage to avoid allocating a list by recursing instead, you do save memory. (But I find it ha
by ColonelPhantom 4y ago
Recursion isn't strictly worse though, due to TCE.
And if you can manage to avoid allocating a list by recursing instead, you do save memory. (But I find it hard to think of such a case, as you can usually just loop over an iterator/generator instead?)