Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Restoring Shortest Path | Practice
/
Breadth First Search
セクション 2.  4
single

single

bookRestoring Shortest Path

メニューを表示するにはスワイプしてください

BFS searching shortest path

That was hard! But now let's implement a method to find the shortest path between two vertices, not only length.

To do that, you have to know for each node where did it come from. So, let's add list pred that contains predcessor for i node. At the beginning, pred contains only -1.

タスク

スワイプしてコーディングを開始

Modify bfs(start, end) so it returns a list of vertices between start and end nodes (both inclusive). If there is no path, return an empty list.

Do not forget to keep the path.

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt