Graph/C/Prim.c
Graph* initGraph(int vexNum) {
    Graph* G = (Graph*)malloc(sizeof(Graph));
    G -> vexs = (char*)malloc(sizeof(char) * vexNum);
    G -> arcs = (int**)malloc(sizeof(int*) * vexNum);
    for (int i = 0 ; i < vexNum; i++) {
        G -> arcs[i] = (int*)malloc(sizeof(int) * vexNum);
    }
    G -> vexNum = vexNum;
    G -> arcNum = 0;
    return G;
}
/**
 * init graph
 * @param vexNum the vex num of graph
 * @return
 */
init graph
@param vexNum the vex num of graph
@return
init graph @param vexNum the vex num of graph @return
Graph* initGraph(int vexNum) {
    Graph* G = (Graph*)malloc(sizeof(Graph));
    G -> vexs = (char*)malloc(sizeof(char) * vexNum);
    G -> arcs = (int**)malloc(sizeof(int*) * vexNum);
    for (int i = 0 ; i < vexNum; i++) {
        G -> arcs[i] = (int*)malloc(sizeof(int) * vexNum);
    }
    G -> vexNum = vexNum;
    G -> arcNum = 0;
    return G;
}
Graph * initGraph ( int vexNum ) { Graph * G = ( Graph * ) malloc ( sizeof ( Graph ) ) ; G -> vexs = ( char * ) malloc ( sizeof ( char ) * vexNum ) ; G -> arcs = ( int * * ) malloc ( sizeof ( int * ) * vexNum ) ; for ( int i = 0 ; i < vexNum ; i ++ ) { G -> arcs [ i ] = ( int * ) malloc ( sizeof ( int ) * vexNum ) ; } G -> vexNum = vexNum ; G -> arcNum = 0 ; return G ; }
init graph
 @param vexNum the vex num of graph
 @return
init graph @param vexNum the vex num of graph @return