4 ms·
On an interview I would, of course, go straight for recursion. In production, and where performance matters, I might try both. A more meaningful interview ques
by ncmncm 5y ago
On an interview I would, of course, go straight for recursion. In production, and where performance matters, I might try both.
A more meaningful interview question would be to present a recursive topo sort and ask for the iterative rendition.
- deleted 5y ago[deleted]