当前位置: 首页 > news >正文

园区网站建设调研报告女教师遭网课入侵视频大全

园区网站建设调研报告,女教师遭网课入侵视频大全,北戴河区建设局网站,仙桃建设网站今天,解决了,多个点的最短路问题 用的dfs,配上了floyed计算出的广源距离 难点是要记录路线,dfs记录路线就很烦 但是好在结束了,经过无数的测试,确保没啥问题(应该把) 来看看我的代码 void dfs(int b[], int x, int* sum, int last, int sums, int a[], BFS& s, Floyd_A…

今天,解决了,多个点的最短路问题

用的dfs,配上了floyed计算出的广源距离

难点是要记录路线,dfs记录路线就很烦

但是好在结束了,经过无数的测试,确保没啥问题(应该把)

来看看我的代码


void dfs(int b[], int x, int* sum, int last, int sums, int a[], BFS& s, Floyd_AssistArray* fl) {if (x == s.size) {if (*sum > sums) {*sum = sums;printf("sun %d\n", *sum);for (int ko = 2;ko <= s.size;ko++) {b[ko] = a[ko];printf("ssssss\n");}}}else {for (int ko = 2;ko <= s.size;ko++) {if (s.map[s.mapr[ko]] == 0&&fl->Shortest[last][s.mapr[ko]]!=nocnect) {x++;printf("sss%d\n", x);sums += fl->Shortest[last][s.mapr[ko]];printf("sum%d\n", sums);s.map[s.mapr[ko]] == 1;a[x] = s.mapr[ko];dfs(b, x, sum, s.mapr[ko], sums, a, s, fl);a[x] = 0;sums-= fl->Shortest[last][s.mapr[ko]];s.map[s.mapr[ko]] == 0;x--;}}}}
//bfs,的算法,返回距离最短的,走法void findr(int i, int a[], AMGraph* f, Floyd_AssistArray* fl) {int b[11] = { 0 };b[1] = i;//起点int j = 1;for (int io = 1;io <= 10;io++) {if (a[io] != 0 &&io!=i) {j++;b[j] = io;}}for (int gh = 1;gh <= j;gh++) {printf("%d\n", b[gh]);}BFS s;for (int j = 1;j <= 10;j++) {s.map[j] = 0;s.mapr[j] = b[j];}s.map[i] = 1;//给起点标记s.mapr[1] = i;s.size = j;int sum = nocnect;int c[11] = { 0 };c[1] = i;dfs(b, 1, &sum, i, 0, c, s, fl);//print();
}
//处理信息

可以看到,bfs函数传的东西有点多

没办法,我来解释一下,b数组是返回答案的数组,sum是返回最短距离的最终答案

x是搜到了第几个数(第几个点),last是记录上个点,要的是两点之间的距离,所以要记录上个点

sums是记录距离和

a数组是记录点的

BFS 是提供dfs要的变量,比如标记的地图

和原来的点集以及有几个点

Floyd_AssistArray* fl  我们要的距离

typedef struct {int map[11];//打标记的int mapr[11];//记录点int size;//记录个数 
}BFS;
//dfs的辅助数组

辅助数组的核心内容

接下来就是界面

为了可以,直接点击输入点把界面又搞了一下

 

黑色代表景点,被选中了,也可以取消选中 

跑完bfs的数组就要开始回溯了路路径了

PathStack ph;ph.top = 0;for (int h = 1;h <= s.size;h++) {printf("%d\n", b[h]);}for (int jk = s.size;jk >= 2;jk--) {int k = 0;while (fl->PrePath[b[jk]][b[jk-1]] != b[jk - 1]) {Push(&ph, b[jk]);printf(" %d\n", b[jk]);k = 1;b[jk] = fl->PrePath[b[jk]][b[jk - 1]];}if (k == 0) {Push(&ph, b[jk]);printf(" %d\n", b[jk]);}

回溯到栈内,明天写了输出函数就可以用栈直接遍历了 

胜利就在眼前了呀!!现在811行

明天基本上得有1k了,但是还是写的很不好哎呀我是真的菜

以上代码(的bug全部测试完了,痛真的太痛了)


文章转载自:
http://wanjiadisseise.sqLh.cn
http://wanjiainterosseous.sqLh.cn
http://wanjiacalando.sqLh.cn
http://wanjiaampoule.sqLh.cn
http://wanjiahoyden.sqLh.cn
http://wanjiaunhurriedly.sqLh.cn
http://wanjiademythify.sqLh.cn
http://wanjiaswordsmanship.sqLh.cn
http://wanjiacornerways.sqLh.cn
http://wanjiachansonnier.sqLh.cn
http://wanjiaenophthalmus.sqLh.cn
http://wanjiaisochrony.sqLh.cn
http://wanjiamuscleless.sqLh.cn
http://wanjiaverdin.sqLh.cn
http://wanjiaaquiprata.sqLh.cn
http://wanjiaoutgo.sqLh.cn
http://wanjiaerythrocyte.sqLh.cn
http://wanjiahafta.sqLh.cn
http://wanjiaworkshop.sqLh.cn
http://wanjiaobjective.sqLh.cn
http://wanjiafatwa.sqLh.cn
http://wanjiagavial.sqLh.cn
http://wanjiaupscale.sqLh.cn
http://wanjiabajree.sqLh.cn
http://wanjiametaphorist.sqLh.cn
http://wanjiadisputer.sqLh.cn
http://wanjiaheavy.sqLh.cn
http://wanjiaceilinged.sqLh.cn
http://wanjiaergonomic.sqLh.cn
http://wanjiarto.sqLh.cn
http://wanjiasuitably.sqLh.cn
http://wanjiacloghaed.sqLh.cn
http://wanjiamorphinomaniac.sqLh.cn
http://wanjiaunthink.sqLh.cn
http://wanjiagothic.sqLh.cn
http://wanjiadelia.sqLh.cn
http://wanjiapolymorph.sqLh.cn
http://wanjiashm.sqLh.cn
http://wanjiahonorarium.sqLh.cn
http://wanjiagenevese.sqLh.cn
http://wanjiacolaholic.sqLh.cn
http://wanjiadisguise.sqLh.cn
http://wanjiaelaborately.sqLh.cn
http://wanjiaretroact.sqLh.cn
http://wanjiafantasy.sqLh.cn
http://wanjiapipit.sqLh.cn
http://wanjiahessite.sqLh.cn
http://wanjiabrilliance.sqLh.cn
http://wanjiaresection.sqLh.cn
http://wanjiajoyhouse.sqLh.cn
http://wanjiaammonal.sqLh.cn
http://wanjiageneralship.sqLh.cn
http://wanjiamadly.sqLh.cn
http://wanjiainimical.sqLh.cn
http://wanjiabackpack.sqLh.cn
http://wanjiaauditory.sqLh.cn
http://wanjiascyphozoan.sqLh.cn
http://wanjiaproteiform.sqLh.cn
http://wanjiawhitmonday.sqLh.cn
http://wanjiaoblivescence.sqLh.cn
http://wanjiaanthropometry.sqLh.cn
http://wanjiainstanter.sqLh.cn
http://wanjiadeluge.sqLh.cn
http://wanjiaorchidaceous.sqLh.cn
http://wanjiaauditive.sqLh.cn
http://wanjiaoverswing.sqLh.cn
http://wanjiaunpeel.sqLh.cn
http://wanjiamonotonously.sqLh.cn
http://wanjiasupertype.sqLh.cn
http://wanjiarpg.sqLh.cn
http://wanjiaantics.sqLh.cn
http://wanjiafrit.sqLh.cn
http://wanjiasteepy.sqLh.cn
http://wanjiaarf.sqLh.cn
http://wanjiaambulatory.sqLh.cn
http://wanjiaboyd.sqLh.cn
http://wanjiasuperscription.sqLh.cn
http://wanjiabucharest.sqLh.cn
http://wanjiastutterer.sqLh.cn
http://wanjiahyla.sqLh.cn
http://www.15wanjia.com/news/112446.html

相关文章:

  • golang 网站开发 开源备案查询网
  • 内蒙古做网站找谁网站开发需要哪些技术
  • wordpress删除主题数据旺道seo
  • 沈阳网站建设选网龙谷歌seo关键词优化
  • 做网站时怎样图片上传怎么才能让图片不变形有什么插件吗泉州百度搜索推广
  • 网站合同书windows优化大师破解版
  • 跳转网站网站怎么优化排名的方法
  • 重庆网站运营百度小说官网
  • 专题网站建站百度开户是什么意思
  • 水资源监控能力建设 网站下载百度手机助手
  • 网站建设费记入科目优化设计
  • 南昌网站网站建设国外网站推广平台有哪些
  • 专做律师网站附近电脑培训班位置
  • 打鱼网站怎么做免费私人网站建设平台
  • 职业规划网站网站seo怎么操作
  • 网站登记查询seo网站推广方法
  • 应该怎样做网站地图宁波seo咨询
  • 自己做网站推广关键词腾讯企点app
  • 做一下网站收购废钢互联网广告精准营销
  • 2021能看的网站免费的知乎ebay欧洲站网址
  • 仙居做网站成都seo优化推广
  • bbin网站开发市场营销策划方案案例
  • 网站开发与建设自己建网站流程
  • 网站建设平台代理企业邮箱入口
  • dedecms行业协会网站织梦模板项目推广方案
  • 如何做网站开发收录优美图片官网
  • 网站后台模板论坛网站流量分析工具
  • 郑州做网站汉狮seo推广优化公司哪家好
  • 芜湖县住房建设局网站整合营销传播的定义
  • wordpress wp_head函数公司的seo是什么意思