3 ms·
I think in this particular case I'd go for the iterative one -- it's impossible to screw up (at least in the "keep track of the indegree" variant, I don't know
by qsort 5y ago
I think in this particular case I'd go for the iterative one -- it's impossible to screw up (at least in the "keep track of the indegree" variant, I don't know if that's what you're thinking)
But the point you're making stands: recursion is first and foremost a thinking tool. Code as you think it need not be the same as code as you type it.