mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-02 05:07:13 +00:00
Bug fixes and improvements (#1813)
* Sync zh and zh-hant version. * Add the Warp sponsor banner. * Update README with acknowledgments and Warp recommendation Added acknowledgments and a recommendation for the Warp terminal application. * Update README.md * Update links in README.md to use HTTPS * Sync zh and zh-hant versions. * Add special thanks for Warp spnsorship. * Use official warp image link.
This commit is contained in:
@@ -22,8 +22,7 @@ fn graph_bfs(graph: GraphAdjList, start_vet: Vertex) -> Vec<Vertex> {
|
||||
let mut que = VecDeque::new();
|
||||
que.push_back(start_vet);
|
||||
// 以頂點 vet 為起點,迴圈直至訪問完所有頂點
|
||||
while !que.is_empty() {
|
||||
let vet = que.pop_front().unwrap(); // 佇列首頂點出隊
|
||||
while let Some(vet) = que.pop_front() {
|
||||
res.push(vet); // 記錄訪問頂點
|
||||
|
||||
// 走訪該頂點的所有鄰接頂點
|
||||
|
||||
Reference in New Issue
Block a user