数据结构课程设计地图着色问题(4)

2020-02-21 00:48

hu118->next=hu119; hu119->next=hu120; hu120->next=hu121; hu121->next=hu122; hu122->next=NULL; sheng[28].name=\hu123->x=27; hu124->x=26; hu125->x=30;

sheng[28].firstnext=hu123; hu123->next=hu124; hu124->next=hu125; hu125->next=NULL;

sheng[29].name=\hu126->x=23; hu127->x=24; hu128->x=25; hu129->x=30;

sheng[29].firstnext=hu126; hu126->next=hu127; hu127->next=hu128; hu128->next=hu129; hu129->next=NULL;

sheng[30].name=\hu130->x=29; hu131->x=25; hu132->x=26; hu133->x=28; hu134->x=31; hu135->x=32; hu136->x=34;

sheng[30].firstnext=hu130; hu130->next=hu131; hu131->next=hu132; hu132->next=hu133; hu133->next=hu134; hu134->next=hu135; hu135->next=hu136; hu136->next=NULL;

sheng[31].name=\hu137->x=30;

sheng[31].firstnext=hu137; hu137->next=NULL;

sheng[32].name=\

16

hu138->x=30;

sheng[32].firstnext=hu138; hu138->next=NULL;

sheng[33].name=\ hu139->x=28;

sheng[33].firstnext=hu139; hu139->next=NULL;

sheng[34].name=\ hu140->x=30;

sheng[34].firstnext=hu140; hu140->next=NULL; for(i=1;i<=34;i++) { sheng[i].color=0; }

for(i=1;i<=34;i++) { j=1; p=sheng[i].firstnext; while(p!=NULL) { while(p!=NULL&&j!=sheng[p->x].color) { p=p->next; } if(p!=NULL) j++; } sheng[i].color=j; }

for(i=1;i<=34;i++) { printf(\ printf(\ }

printf(\表示白色,1表示蓝色,2表示红色,3表示绿色,4表示黄色\ return 0; }

17


数据结构课程设计地图着色问题(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:黄帝内经怎么学习才能入门?

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: