2. Let $2 n$ real numbers $a_{1}, a_{2}, \cdots, a_{2 n}$ satisfy the condition
$$
\begin{array}{c}
\sum_{i=1}^{2 n-1}\left(a_{i+1}-a_{i}\right)^{2}=1 . \\
\text { Find the maximum value of }\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right) \text { . }
\end{array}
$$
2. When $n=1$, $\left(a_{2}\right.$ $\left.-a_{1}\right)^{2}=1$, hence $a_{2}-a_{1}=$ $\pm 1$. It is easy to see that the maximum value sought is 1.
When $n \geqslant 2$, let $x_{1}$
$$
\begin{array}{l}
=a_{1}, x_{i+1}=a_{1+1}-a_{1}, \\
i=1,2, \cdots, 2 n-1 \text {. Then } \\
\sum_{i=2}^{2 n} x_{i}^{2}=1, \text { and } a_{k}=x_{1}+x_{2}+\cdots+x_{k}, k=1,2, \cdots, 2 n .
\end{array}
$$

By the Cauchy-Schwarz inequality, we have
$$
\begin{aligned}
& \left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
= & n\left(x_{1}+x_{2}+\cdots+x_{n}\right)+n x_{n+1}+(n-1) x_{n+2}+ \\
& \cdots+x_{2 n}-\left[n x_{1}+(n-1) x_{2}+\cdots+x_{n}\right] \\
= & x_{2}+2 x_{3}+\cdots+(n-1) x_{n}+n x_{n+1}+ \\
& (n-1) x_{n+2}+\cdots+x_{2 n} \\
\leqslant & {\left[1^{2}+2^{2}+\cdots+(n-1)^{2}+n^{2}+(n-1)^{2}+\cdots+1^{2}\right]^{\frac{1}{2}} . } \\
& \left(x_{2}^{2}+x_{3}^{2}+\cdots+x_{2 n}^{2}\right)^{\frac{1}{2}} \\
= & {\left[n^{2}+2 \times \frac{1}{6}(n-1) n(2(n-1)+1)\right]^{\frac{1}{2}} } \\
= & \sqrt{\frac{n\left(2 n^{2}+1\right)}{3}} .
\end{aligned}
$$

When $a_{k}=a_{1}+\frac{\sqrt{3} k(k-1)}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1,2, \cdots, n+1$,
$$
a_{n+k+1}=a_{1}+\frac{\sqrt{3}\left[2 n^{2}-(n-k)(n-k-1)\right]}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1 \text {, }
$$
$2, \cdots, n-1$, the equality in the above inequality holds. Therefore,
$$
\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right)
$$

has a maximum value of $\sqrt{\frac{n\left(2 n^{2}+1\right)}{3}}$.