diff --git a/06_breadth-first_search/Scala Solutions b/06_breadth-first_search/Scala Solutions index 20c4b60..674fd85 100644 --- a/06_breadth-first_search/Scala Solutions +++ b/06_breadth-first_search/Scala Solutions @@ -26,9 +26,6 @@ object BreadthFirstSearch extends App { var searched = Array() var seller = false while (!seller) { - if (searchQue.isEmpty) - println("No Mango Sellers") - else { val person = searchQue.dequeue() if (!searched.contains(person)){ if (personIsSeller(person)) { @@ -40,12 +37,13 @@ object BreadthFirstSearch extends App { println("No Mango Sellers") seller = true } - else + else { searchQue ++= graph(person) searched + person + } } } - } + } }