#include<stdio.h>
#include<malloc.h>
#include<string.h>
/*----------------------------邻接多重表的存储结构---------------------------*/
#define MAX_VERTEX_NUM 20
typedef int VRType;
typedef int VertexType;
int visited[MAX_VERTEX_NUM];
int low[MAX_VERTEX_NUM];
int count;
struct EBox {
int mark;
int ivex,jvex;
struct EBox *ilink,*jlink;
/* VRType weight; */
};
struct VexBox {
VertexType data;
struct EBox *firstedge;
};
typedef struct {
struct VexBox adjmulist[MAX_VERTEX_NUM];
int vexnum,arcnum;
}AMLGraph;
/*==========森林========*/
struct CSNode {
int data;
struct CSNode *firstchild,*nextsibling;
};
/*============================================================================*/
/* */
/* 顺 序 队 列 */
/* */
/*============================================================================*/
typedef struct{
int data;
}elemtype;
#define QUEUE_MAXSIZE 100
typedef struct{
elemtype elem[QUEUE_MAXSIZE];
int front ,rear;
int length;
}QUEUE;
void queue_init(QUEUE *q)
{
(*q).front=(*q).rear=-1; (*q).length=0;
}
int queue_empty(QUEUE *q)
{
if((*q).length==0) return 1;
else return 0;
}
void queue_push(QUEUE *q,elemtype e)
{
if((*q).length==QUEUE_MAXSIZE) { printf("QUEUE IS FULL"); return ;}
(*q).rear=++(*q).rear%QUEUE_MAXSIZE;
(*q).elem[(*q).rear]=e;
(*q).length++;
if((*q).length==1&&(*q).front==-1) (*q).front=0;
}