make search return true when mango seller is found (#99)

This commit is contained in:
Yusuf Qedan
2019-03-28 14:53:30 -07:00
committed by Aditya Bhargava
parent 5b675cc2e8
commit cc845c40f7

View File

@@ -14,6 +14,7 @@ public class BreadthFirstSearch {
if (!searched.contains(person)) { if (!searched.contains(person)) {
if (person_is_seller(person)) { if (person_is_seller(person)) {
System.out.println(person + " is a mango seller!"); System.out.println(person + " is a mango seller!");
return true;
} else { } else {
searchQueue.addAll(graph.get(person)); searchQueue.addAll(graph.get(person));
// Marks this person as searched // Marks this person as searched