
#include<queue>
using namespace std;
void BFS(Graph G, int v)
{
    visited[v] = 1;
    queue<int> q;
    q.push(v);
    while (!q.empty()) 
    {
        int front = q.front();
        q.pop();
        printf("%c ", G.vexs[front]);
        for (int i = 0; i < G.vexnum; i++) 
        {
            if (!visited[i] && G.arcs[front][i]) 
            {
                q.push(i);
                visited[i] = 1;
            }
        }
    }
}










