Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Check if is One Component | Practice
Breadth First Search
course content

Contenido del Curso

Breadth First Search

Breadth First Search

1. What is BFS
2. Practice
3. Improve Your Code
4. Solving the Problems using BFS

Check if is One Component

BFS: check if graph is one-component

In the previous method, we considered that the graph is one-component. That’s because if you start traversing at some node, you’ll visit only nodes from the same component.

If there are some other components, you should start from vertices of another component.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 2. Capítulo 2
toggle bottom row

Check if is One Component

BFS: check if graph is one-component

In the previous method, we considered that the graph is one-component. That’s because if you start traversing at some node, you’ll visit only nodes from the same component.

If there are some other components, you should start from vertices of another component.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 2. Capítulo 2
toggle bottom row

Check if is One Component

BFS: check if graph is one-component

In the previous method, we considered that the graph is one-component. That’s because if you start traversing at some node, you’ll visit only nodes from the same component.

If there are some other components, you should start from vertices of another component.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

BFS: check if graph is one-component

In the previous method, we considered that the graph is one-component. That’s because if you start traversing at some node, you’ll visit only nodes from the same component.

If there are some other components, you should start from vertices of another component.

Tarea

Think about Implementation of method hasOneComponent(). which returns True if it is only one component in graph.

Modify your g graph by adding nodes in that way, so there are miltiple components, and check how function works.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 2. Capítulo 2
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt