#include<queue>
using namespace std;
void BFS(ALGraph G, int v)
{
queue<int> q;
q.push(v);
visited[v] = 1;
while (!q.empty())
{
int front = q.front();
q.pop();
printf("%c ", G.vertices[front].data);
for (ArcNode* cur = G.vertices[front].firstarc; cur != nullptr; cur = cur->nextarc)
{
if (!visited[cur->adjvex])
{
q.push(cur->adjvex);
visited[cur->adjvex] = 1;
}
}
}
}