BFS
-
BFS(Breadth First Search)Computer Engineering/자료구조 2019. 9. 23. 22:01
- C++ #include #include #include using namespace std; int number = 7; int c[7]; vector a[8]; void bfs(int start) { queue q; q.push(start); c[start] = true; while (!q.empty()) { int x = q.front(); q.pop(); printf("%d", x); for(int i=0;i