Зміст курсу
Breadth First Search
Breadth First Search
Components Methods
First, Copy and Paste the whole implemented class Graph
to the Editor, and save it somewhere outside for safety.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Все було зрозуміло?
Components Methods
First, Copy and Paste the whole implemented class Graph
to the Editor, and save it somewhere outside for safety.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Все було зрозуміло?
Components Methods
First, Copy and Paste the whole implemented class Graph
to the Editor, and save it somewhere outside for safety.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.
Все було зрозуміло?
First, Copy and Paste the whole implemented class Graph
to the Editor, and save it somewhere outside for safety.
Завдання
We can use getComponents()
inside hasOneComponent()
function, and return True
if answer consists of one component. Let's leave getComponents()
as it is, and change hasOneComponent()
by calling getComponents()
inside it, and analyzing the answer.