...

/

DIY: Number of Connected Components in an Undirected Graph

DIY: Number of Connected Components in an Undirected Graph

Solve the interview question "Number of Connected Components in an Undirected Graph" in this lesson.

Problem statement

Suppose you are given an undirected graph with n nodes. You are also given an integer n and an array edges where edges[i] = [xi, yi] indicates that there is an edge between xi and ...

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