# Maximum number of components in a Graph Containing $n$ vertices and $k$ edges

I know that in a Graph $G$ Containing $n$ vertices and $k$ edges,$G$ will contain atleast $n-k$ components.

Explanation-:

Graph containing $n$ vertices and $0$ edges will contain $n$ components.Each time adding an edge will reduce the component by 1.Thus $k$ edge will contain $n-k$ component. This is the minimum number.

In the worst case the edges are used to form a clique. Let $i$ be the smallest integer $\ge 1$ s.t. $\frac{i(i-1)}{2} \ge k$. There are $n-i+1$ connected components in that case, which is maximal posible.
The maximum number of components comes from using complete graphs. For instance, with two edges, you lose two components. With three edges, you can make a complete subgraph and lose no edges. The result is $n-l$ such that $l$ is the lowest integer satisfying $k\le \frac{l(l+1)}2$, where $k$ is the number of edges, $n$ is the number of nodes.