赞
踩
Typedef Struct node{ Int adj; Struct node *next; }arcnode; Typedef Struct{ Element vex; arcnode *first; }listnode; Typedef Struct graph{ Int count; Listnode data[size]; }; Firstnode (graph G,int i){ graph *p; p=new graph; p=p.data[i]->first; //此时P就为该元素的第一个邻接点 return p; } Nestnode(gragh,int i,int w){ graph *p; p=new graph; p=p.data[i]->first; if(p && p->adj != w){ p=p->next; } return p; //此时P就为该元素的下一个邻接点 }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。