(graph, visited, queue)
| 81 | }; |
| 82 | |
| 83 | const bfs = (graph, visited, queue) => { |
| 84 | while (!queue.isEmpty()) { |
| 85 | for (let i = queue.size() - 1; 0 <= i; i--) { |
| 86 | checkNeighbor(graph, visited, queue); |
| 87 | } |
| 88 | } |
| 89 | }; |
| 90 | |
| 91 | const checkNeighbor = (graph, visited, queue) => { |
| 92 | const node = queue.dequeue(); |
no test coverage detected