摘要:
【题目描述】基于“链式前向星”存图,请编程输出下图的 DFS、BFS 序列。 【基于“链式前向星”的 DFS 代码】 #include <bits/stdc++.h> using namespace std; const int N=1e5+5; int h[N],e[N<<1],ne[N<<1] 阅读全文
posted @ 2025-12-14 18:28
Triwa
阅读(11)
评论(0)
推荐(0)
摘要:
【题目描述】基于“邻接表”存图,请编程输出下图的 DFS、BFS 序列。 【基于“邻接表”的 DFS 代码】 #include <bits/stdc++.h> using namespace std; const int N=1e5+5; vector<int> g[N]; bool st[N]; 阅读全文
posted @ 2025-12-14 18:12
Triwa
阅读(13)
评论(0)
推荐(0)

浙公网安备 33010602011771号