\begin{algorithm}
\caption{Binary Tree Traversal Recursive}
\begin{algorithmic}
\REQUIRE a binary tree $T$
\ENSURE print all keys appearing in $T$
\PROCEDURE{PrintTree}{$x$}
\IF{$x == NIL$}
\RETURN
\ENDIF
\PRINT $x.key$
\STATE \CALL{PrintTree}{$x.left$}
\STATE \CALL{PrintTree}{$x.right$}
\ENDPROCEDURE
\STATE
\STATE \CALL{PrintTree}{$T.root$}
\end{algorithmic}
\end{algorithm}