Re:It is humiliating to have to do LeetCode grinding for
by HDThoreaun on Thursday November 28, 2024 @10:18PM
(#42270505)
Absolutely 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
Re:It is humiliating to have to do LeetCode grinding for
by marcosdumay on Friday November 29, 2024 @08:34AM
(#42273743)
What? Neither of them are efficient in any practical sense.
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.