DFS solves connectivity [00MD]

Assuming all vertices start out unvisited, \mathsf {DFS}(G,s) ends up visiting t if and only if s and t are connected.