  The Askey-Wilson algebra is realized in terms of the elements of the quantum
algebras $U_q(\mathfrak{su}(2))$ or $U_q(\mathfrak{su}(1,1))$. A new
realization of the Racah algebra in terms of the Lie algebras
$\mathfrak{su}(2)$ or $\mathfrak{su}(1,1)$ is given also. Details for different
specializations are provided. The advantage of these new realizations is that
one generator of the Askey-Wilson (or Racah) algebra becomes diagonal in the
usual representation of the quantum algebras whereas the second one is
tridiagonal. This allows to recover easily the recurrence relations of the
associated orthogonal polynomials of the Askey scheme. These realizations
involve rational functions of the Cartan generator of the quantum algebras,
they are linear with respect to the other generators and depend on the Casimir
element of the quantum algebras.
