...

/

Number of Connected Components in an Undirected Graph

Number of Connected Components in an Undirected Graph

Try to solve the Number of Connected Components in an Undirected Graph problem.

Statement

For a given integer, n, and an array, edges, return the number of connected components in a graph containing n nodes.

Note: The array edges[i] = [x, y] indicates that there’s an edge between x and y in the graph. ...

Access this course and 1200+ top-rated courses and projects.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy