  In this paper, a new method is presented to compute the 2-adic complexity of
pseudo-random sequences. With this method, the 2-adic complexities of all the
known sequences with ideal 2-level autocorrelation are uniformly determined.
Results show that their 2-adic complexities equal their periods. In other
words, their 2-adic complexities attain the maximum. Moreover, 2-adic
complexities of two classes of optimal autocorrelation sequences with period
$N\equiv1\mod4$, namely Legendre sequences and Ding-Helleseth-Lam sequences,
are investigated. Besides, this method also can be used to compute the linear
complexity of binary sequences regarded as sequences over other finite fields.
