3 ms·
> recursive == DFS The intuition there is that people tend to write algorithms recursively when they easily map to interactions with the top of the stack, sinc
by hansvm 2y ago
> recursive == DFS
The intuition there is that people tend to write algorithms recursively when they easily map to interactions with the top of the stack, since that's easier to express in most languages than bringing in an external stack to think about. Hence, if you see something recursive in the wild it likely looks more like DFS than BFS. As you point out, that isn't a hard rule.