静态邻接表的建立

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Seeyouer/article/details/78662618
struct edge{
    int end,next;
}e[1000];
int head[1000],cnt=0;
void add(int start,int end){//头插法,单向
    e[cnt]={end,head[start]};
    head[start]=cnt;//记录下标
    cnt++;
}

猜你喜欢

转载自blog.csdn.net/Seeyouer/article/details/78662618