94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
int MaxDegree(Graph *G, char *mess, List *arc_edges, List *verts){
Node N;
int i,maxdeg;

    /* Testa se o grafo esta vazio */
    if (G->size < 1) {
        sprintf(mess, "%s", "Empty graph!");
        return 1;
    }

    /* Procurar pelo vertice de maior grau */
    maxdeg = 0;
    for (i = 1; i < G->size; i++) {
        if (G->vertex[i].degree > G->vertex[maxdeg].degree) {
            maxdeg = i;
        }
    }

    /* Coloca em um novo nodo o vertice de maior grau */
    N = MakeNode(&maxdeg, sizeof(int));

    /* Coloca o nodo na lista de vertices especiais */
    InsertNode(verts, N);

    return 1;
}