+ 14
When using a breadth or depth first search algorithm in a tree search, how do you know which is better to use out of the two?
Does it depend on the structure/width of the organised data tree?
3 ответов
+ 5
It depends on your scenario.
Typically both have more-or-less the same time complexity
+ 3
Breadth first search is more efficient... when compared to depth first search
+ 2
You should look into big O notation. It gets into how to figure out how much time complexity certain algorithms have.
MIT has a free corse on YouTube from 2011 I believe. I have currently been going through it and taking notes. Should be called MIT 6.006 on YouTube.