typedef struct
{
int numVertices, numEdges;
char VerticesList[MAXV];
int Edge[MAXV][MAXV];
}MGraph;
int IsExistEL(MGraph G)
{
int cnt = 0;
for (int i = 0; i < G.numVertices; i ++ )
{
int d = 0;
for (int j = 0; j < G.numVertices; j ++ )
{
if (G.Edge[i][j] == 1) d ++ ; // 计算结点i的度
}
if (d % 2 != 0) cnt ++ ; // 度为奇数
}
if (cnt == 0 || cnt == 2) return 1; // 存在EL路径 返回1
else return 0; // 不存在EL路径 返回0
}
// 时间复杂度O(n^2) 空间复杂度 O(1)