10. The sequence $\left\{a_{n}\right\}$ of $n$ terms, formed by the permutation of $1,2, \cdots, n$, satisfies: each term is greater than all the terms before it or less than all the terms before it. Then the number of sequences $\left\{a_{n}\right\}$ that satisfy this condition is $\qquad$.
10. $2^{n-1}$.

Let the number we are looking for be $A_{n}$. Then $A_{1}=1$.
For $n>1$, if $n$ is in the $i$-th position, then the $n-i$ positions after it are completely determined, and can only be $n-i, n-i-1$, $\cdots, 2,1$. The $i-1$ positions before it, $n-i+1, n-i+2$, $\cdots, n-1$ have $A_{i-1}$ ways of arrangement.
Let $i=1,2, \cdots, n$. Then
$$
\begin{array}{l}
A_{n}=1+A_{1}+\cdots+A_{n-2}+A_{n-1} \\
=\left(1+A_{1}+\cdots+A_{n-2}\right)+A_{n-1} \\
=A_{n-1}+A_{n-1}=2 A_{n-1} .
\end{array}
$$

This gives $A_{n}=2^{n-1}$.