LeetCode 323: Number Of Connected Components In An Undirected Graph — Step-by-Step Visual Trace
Medium — Graph | Depth-First Search | Union Find | Connected Components
The Problem
Given n nodes labeled from 0 to n-1 and a list of undirected edges, return the number of connected components in the graph.
Approach
Build an adjacency list represent...
blog.tracelit.dev1 min read