图的遍历
triumph_666
这个作者很懒,什么都没留下…
展开
-
图的BFS中关于visit数组的位置问题
图的BFS中关于visit访问位置的问题图的BFS两种代码代码1#include<bits/stdc++.h>using namespace std;#define inf 0x3f3f3f3fint G[1010][1010];bool visit[1010];int vex, L; int height[1010];void bfs(int root, int &cnt){ queue<int> q; q.push(root); height[原创 2022-02-19 17:30:22 · 448 阅读 · 0 评论 -
pat图的遍历
图的遍历图的遍历分析P1013P1021P1034P1076小结图的遍历1013. Battle Over Cities (25)-PAT甲级真题(图的遍历,统计强连通分量的个数,dfs)1021. Deepest Root (25)-PAT甲级真题(图的遍历,dfs,连通分量的个数)1034. Head of a Gang (30)-PAT甲级真题(图的遍历dfs)1076. Forwards on Weibo (30)-PAT甲级真题(图的遍历bfs)分析 难度:1034=1076>原创 2021-03-30 20:39:07 · 125 阅读 · 0 评论