Diameter of a disconnected graph
The distance $d_G(u,v)$ between two disconnected vertices $u,v$ of a graph is usually defined as $+\infty$.
As a consequence the diameter of a disconnected graph $G=(V,E)$ is
$$
\textrm{diam}(G) = \max_{u,v \in V} d_G(u,v) = + \infty.
$$