Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn BFT and BFS | Improve Your Code
Breadth First Search

bookBFT and BFS

First, Copy and Paste the whole implemented class Graph to the Editor, and save it somewhere outside for safety.

BFS and BFT do the same action, too, but in bfs() we search until end vertex is found. Actually, we can pass unnecessary end node to the bft() and change algorithm a bit, but avoid using to almost the same functions bfs() and bft().

Task

Swipe to start coding

Change the bft() function by adding an unnecessary vertex end as a parameter, so you could refactor it like the bfs() function.

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 3
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Summarize this chapter

Explain the code in file

Explain why file doesn't solve the task

close

Awesome!

Completion rate improved to 7.69

bookBFT and BFS

Swipe to show menu

First, Copy and Paste the whole implemented class Graph to the Editor, and save it somewhere outside for safety.

BFS and BFT do the same action, too, but in bfs() we search until end vertex is found. Actually, we can pass unnecessary end node to the bft() and change algorithm a bit, but avoid using to almost the same functions bfs() and bft().

Task

Swipe to start coding

Change the bft() function by adding an unnecessary vertex end as a parameter, so you could refactor it like the bfs() function.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 7.69
SectionΒ 3. ChapterΒ 3
single

single

some-alt