Let $\left(d_{1}, d_{2}, \ldots, d_{n}\right)$ be a sequence of $n$ nonnegative integers whose sum $d_{1}+d_{2}+$ $\cdots+d_{n}$ is even. Prove that there exists a general graph with this sequence as its degree sequence. Devise an algorithm to construct such a general graph.