摘要: 【拓扑排序/图的BFS】 有向图 重边 自环 图的BFS 【思路】 queue<-1 while(queue不空){ t<-队头 拓展t所有邻边x if(x未遍历){ queue<-x d[x]=d[t]+1 } } 例题:图中点的层次 https://www.acwing.com/problem/ 阅读全文
posted @ 2024-12-13 01:14 White_ink 阅读(24) 评论(0) 推荐(0)