3 ms·
> BFS vs DFS Yet, on the real world the answer is always one of "either" or "neither". Anyway, most leetcode aren't of the type of "a widely applicable algori
by marcosdumay 2y ago
> BFS vs DFS
Yet, on the real world the answer is always one of "either" or "neither".
Anyway, most leetcode aren't of the type of "a widely applicable algorithm solves this". People only know the algorithms that apply to them because they studied those problems specifically.
And notice that one of the algorithms on your post is named after a researcher from the 80s. That's some 40 years after computer science became a thing. That's how long it took the entire humanity for learning it without anybody specifically telling it to them.
- HDThoreaun 2y agoAbsolutely not lmao. Many problems are more efficiently solved with bfs vs dfs or vice versa. If the problem requires you to reach a leaf dfs is usually better
- marcosdumay 2y agoWhat? Neither of them are efficient in any practical sense.