You have a graph of `n` nodes. You are given an integer `n` and an array `edges` where `edges[i] = [a_i, b_i]` indicates that there is an edge between `a_i` and `b_i` in the graph. Return the number of connected components in the graph.
Graph Traversal (DFS/BFS)
A connected component is a maximal set of nodes where any two nodes are reachable from each other. We can count components by iterating through all nodes. For each unvisited node, we start a DFS/BFS to mark all reachable nodes as visited. Each time we start a traversal from an unvisited node, we've found a new connected component.