  The extremal functions $ex_{\rightarrow}(n,F)$ and $ex_{\cir}(n,F)$ for
ordered and convex geometric acyclic graphs $F$ have been extensively
investigated by a number of researchers. Basic questions are to determine when
$ex_{\rightarrow}(n,F)$ and $ex_{\cir}(n,F)$ are linear in $n$, the latter
posed by Bra\ss-K\'arolyi-Valtr in 2003. In this paper, we answer both these
questions for every tree $F$.
  We give a forbidden subgraph characterization for a family $\cal T$ of
ordered trees with $k$ edges, and show that $ex_{\rightarrow}(n,T) = (k - 1)n -
{k \choose 2}$ for all $n \geq k + 1$ when $T \in {\cal T}$ and
$ex_{\rightarrow}(n,T) = \Omega(n\log n)$ for $T \not\in {\cal T}$. We also
describe the family of the convex geometric trees with linear Tur\' an number
and show that for every convex geometric tree $F$ not in this family,
$ex_{\cir}(n,F)= \Omega(n\log \log n)$.
