102
Chapter 6
I
Breadth-first search
This way, you not only search your friends, but you search their friends,
too. Remember, the goal is to find one mango seller in your network.
So if Alice isn’t a mango seller, you add her friends to the list, too. That
means you’ll eventually search her friends—and then their friends, and
so on. With this algorithm, you’ll search your entire network until you
come across a mango seller. This algorithm is breadth-first search.
Dostları ilə paylaş: