该怎么解决这些错误
#include<stdio.h>
#include<stdlib.h>
#define MAXQSIZE 100 //队列可能达到的最大长度
#define OK 1
#define ERROR 0
#define OVERFLOW -2
//以下为顺序队列
//------------队列的顺序存储结构-------------
//类型定义
typedef int Status;
typedef VerTexType QElemType;
typedef struct
{
QElemType *base; // 存储空间的基地址
int front; // 头指针,若队列不空,指向队列头元素
int rear; // 尾指针,若队列不空,指向队尾元素的下一个位置
} SqQueue;
//基本操作的函数声明:
//循环队列的初始化
Status InitQueue (SqQueue &Q);
//入队
Status EnQueue (SqQueue &Q, QElemType e);
//出队
Status DeQueue (SqQueue &Q, QElemType &e);
//取队列长度
int QueueLength (SqQueue Q);
#include "Queue.h"
//循环队列的初始化
Status InitQueue (SqQueue &Q)
{
// 构造一个空队列Q
Q.base=new QElemType[MAXQSIZE];
if (!Q.base)
exit(OVERFLOW); // 存储分配失败
Q.front=Q.rear=0;
return OK;
}
//入队
Status EnQueue (SqQueue &Q, QElemType e)
{
// 插入元素e为Q的新的队尾元素
if ((Q.rear+1) % MAXQSIZE==Q.front)
return ERROR; //队列满
Q.base[Q.rear]=e;
Q.rear=(Q.rear+1) % MAXQSIZE;
return OK;
}
//出队
Status DeQueue (SqQueue &Q, QElemType &e)
{
// 删除Q的队头元素,用e返回其值
if (Q.front == Q.rear) return ERROR;
e = Q.base[Q.front];
Q.front=(Q.front+1)%MAXQSIZE;
return OK;
}
#ifndef GRAPH_H_INCLUDED
#define GRAPH_H_INCLUDED
#define MAXInt 32767
#define MVNum 100
#define OK 1
#define ERROR 0
//②/****邻接矩阵****/
typedef int VerTexType;
typedef int Status;
typedef int ArcType;
typedef struct
{
VerTexType vexs[MVNum];//顶点表
ArcType arcs[MVNum][MVNum];//邻接矩阵
int vexnum,arcnum;//图当前点数和边数
} AMGraph;
//③/****邻接表****/
typedef int OtherInfo;
typedef struct ArcNode//边结点
{
int adjvex;//边所指向的顶点的位置
struct ArcNode * nextarc;//指向下一条边的指针
OtherInfo info;//和边相关的信息
}ArcNode;
typedef struct VNode//顶点信息
{
VerTexType data;
ArcNode *firstarc;//指向第一条依附该顶点的边的指针
}VNode,AdjList[MVNum];//AdjList表示邻接表类型
typedef struct
{
AdjList vertices;
int vexnum,arcnum;
}ALGraph; //图的当前顶点数和边数
Status CreateUNG(AMGraph &G);//创建无向图
void PrintAMGraph(AMGraph G);//打印图的顶点表和邻接矩阵
void DFS_AM(AMGraph G,int v);//深度优先遍历
void BFS(AMGraph G,int v);//广度优先遍历
void Initvisited(bool visited[]);//初始化visited数组
//③/****邻接表****/
Status CreateUDG_AL(ALGraph &G);//采用邻接表法创建无向图
void PrintALGraph(ALGraph G);//打印邻接表
void DFS_AL(ALGraph G,int v);//邻接表表示图的深度优先搜索遍历
void BFS_AL(ALGraph G,int v);//广度优先遍历
#endif // GRAPH_H_INCLUDED
#include "Graph.h"
#include <iostream>
#include "Queue.h"
using namespace std;
//邻接矩阵创建无向网
Status CreateUNG(AMGraph &G)
{
cout<<"请输入图的顶点数目:\n";
cin>>G.vexnum;
cout<<"请输入图的边数:\n";
cin>>G.arcnum;
cout<<"请输入顶点:\n";
for(int i=1; i<=G.vexnum; ++i)
{
cin>>G.vexs[i];
}//依次输入顶点的信息
for(int i=1; i<=G.vexnum; ++i)
{
for(int j=1; j<=G.vexnum; ++j)
G.arcs[i][j]=0;
}//初始化邻接矩阵
cout<<"请输入边:\n";
for(int k=1; k<=G.arcnum; ++k)//构造邻接矩阵
{
VerTexType v1,v2;
cin>>v1>>v2;//输入一条边依附的顶点及权值
G.arcs[v1][v2]=1;//定位顶点
G.arcs[v2][v1]=1;
}
return OK;
}
//②//打印图的顶点表和邻接矩阵
void PrintAMGraph(AMGraph G)
{
cout<<"顶点表为:\n";
for(int i=1; i<=G.vexnum; ++i)
{
cout<<G.vexs[i]<<" ";
}
cout<<"\n邻接矩阵:\n";
for(int i=1; i<=G.vexnum; ++i)
{
for(int j=1; j<=G.vexnum; ++j)
{
cout<<G.arcs[i][j]<<"\t";
}
cout<<"\n";
}
}
bool visited[MVNum]= {false};
void DFS_AM(AMGraph G,int v)//深度优先遍历
{
cout<<v<<" ";
visited[v]=true;
for(int w=1; w<=G.vexnum; w++)
{
if((G.arcs[v][w]!=0)&&(!visited[w]))
DFS_AM(G,w);
}
}
//③//广度优先遍历
void BFS(AMGraph G,int v)
{
Initvisited(visited);
cout<<v<<" ";
visited[v]=true;
SqQueue Q;
InitQueue(Q);
EnQueue(Q,v);//V入队
while(Q.front!=Q.rear)
{
VerTexType u;
DeQueue(Q,u);
for(int w=1; w<=G.vexnum; w++)
{
if(G.arcs[u][w]==1&&visited[w]==false)
{
cout<<w<<" ";
visited[w]=true;
EnQueue(Q,w);
}
}
}
}
//④//初始化visited数组
void Initvisited(bool visited[])
{
for(int i=0; i<MVNum; ++i)
{
visited[i]=false;
}
}
//****************邻接表法******************
//⑤//确定点v在G中的位置
int LocateVex(ALGraph G, VerTexType v)
{
for(int i=0; i<G.vexnum; ++i)
if(G.vertices[i].data==v)
return i;
return -1;
}//LocateVex
//⑥//采用邻接表法创建无向图
Status CreateUDG_AL(ALGraph &G)
{
int i,j,k;
VerTexType v1,v2;
cout<<"please input vexnum and arcnum:\n";
cin>>G.vexnum>>G.arcnum;//总顶点数,总边数
cout<<"please input vertex:\n";
for(i=0; i<G.vexnum; ++i)
{
cin>>G.vertices[i].data;//输入顶点值
G.vertices[i].firstarc=NULL;//初始化表头结点指针域为NULL
}
cout<<"please input side vertex:\n";
for(k=0; k<G.arcnum; ++k) //输入各边,构造边表
{
cin>>v1>>v2;//输入一条边依附的两个顶点
i=LocateVex(G,v1);
j=LocateVex(G,v2);//确定v1和v2在G中的位置,即顶点在 G.vertices中的序号
ArcNode *p1=new ArcNode;
ArcNode *p2=new ArcNode;//生成一个新的边结点*p1
p1->adjvex=j;//邻接点序号为j
p1->nextarc=G.vertices[i].firstarc;//将新结点*p1插入顶点 v1的边表头部
G.vertices[i].firstarc=p1;
// p2=new ArcNode;//生成另一个对称的边结点*p2
p2->adjvex=i;//邻接点序号为i
p2->nextarc=G.vertices[j].firstarc;//将新结点*p2插入顶点 v1的边表头部
G.vertices[j].firstarc=p2;
}
return OK;
}
//⑦//打印邻接表
void PrintALGraph(ALGraph G)
{
int i;
for(i=0; i<G.vexnum; ++i)
{
VNode temp=G.vertices[i];
ArcNode *p=temp.firstarc;
//输出顶点
if(p==NULL)//p空,说明前面没有结点指向
{
cout<<G.vertices[i].data<<"\n";
}
else//不空,说明有结点指向
{
cout<<temp.data;//输出存放的顶点
cout<<":";
while(p)
{
cout<<p->adjvex<<" ";
p=p->nextarc;//一次输出完成,换下一个
}
}
cout<<"\n";
}
}
//⑧//邻接表表示图的深度优先搜索遍历
void DFS_AL(ALGraph G,int v)
{
ArcNode *p;
int w;
cout<<v<<" ";
visited[v]=true;//访问第V个顶点
p=G.vertices[v].firstarc;//p指向v的边链表的第一个边结点
while(p!=NULL)//边界点非空
{
w=p->adjvex;//w是v的邻接点
if(!visited[w])//如果w未访问,递归调用DFS_AL()
{
DFS_AL(G,w);
}
p=p->nextarc;//p指向下一个边结点
}
}
//⑨//广度优先遍历
void BFS_AL(ALGraph G,int v)
{
Initvisited(visited);
cout<<G.vertices[v].data<<" ";
visited[v]=true;
SqQueue Q;
InitQueue(Q);
EnQueue(Q,G.vertices[v].data);
while(Q.front!=Q.rear)
{
int i= GetHead(Q);
DeQueue(Q,v);
ArcNode *p = G.vertices[v].firstarc;
while(p!=NULL)
{
int j = p->adjvex;
if(!visited[j])
{
cout<<G.vertices[j].data<<" ";
visited[j]=true ;
EnQueue(Q,j);
}
p = p->nextarc;
}
}
}
#include <iostream>
#include "Graph.h"
#include "Queue.h"
#include <stdio.h>
using namespace std;
int main()
{
VerTexType v;
AMGraph G;
CreateUNG(G);
PrintAMGraph(G);
cout<<"please input start vertex:";
cin>>v;
cout<<"DFS:";
DFS_AM(G,v);
cout<<"\nBFS:";
BFS(G,v);
}
int main()
{
VerTexType v;
ALGraph G;
CreateUDG_AL(G);
cout<<"please input start vertex:";
cin>>v;
PrintALGraph(G);
cout<<"DFS:";
DFS_AL(G,v);
}

int main()
{
VerTexType v;
ALGraph G;
CreateUDG_AL(G);
cout<<"please input start vertex:";
cin>>v;
cout<<"\nBFS:";
BFS_AL(G,v);
}