I have a figure that contains two tables, I would like to give format to them.
What would be the best option?
{\footnotesize\begin{figure} [h!tb]
\centering
\begin{tabular} {l }
\hline
\textcolor{sql}{double} N;\\
\textcolor{sql}{double}[] L;\\
\textcolor{sql}{double}[,] Q;\\
\textcolor{sql}{int} d;\\
\textcolor{sql}{double}[,]rho;\\
\textcolor{sql}{public} NLQ(\textcolor{sql}{int} dimension) \{ \\
~~d = dimension;\\
~~N = 0.0;\\
~~L = new \textcolor{sql}{double}[d];\\
~~Q = new \textcolor{sql}{double}[d, d];\\
\} \\
\hline
\end{tabular}
\begin{tabular} {l }
\hline
\textbf{in}: $record$, $d$ \\
1 :$n$ += 1\\
2: \textcolor{sql}{For} i=0 to d\\
3: ~~~~$L_i$ += $record_i$\\
4: ~~~~\textcolor{sql}{For} j=0 to i\\
5: ~~~~~~~~$Q_{i,j}$=$Q_{j,i}$= $record_i$*$record_j$ \\
6:~~~~~\textcolor{sql}{End}\\
7:\textcolor{sql}{End}\\
\textbf{out:} $n$, $L$, $Q$ \\
\hline
\end{tabular}
\caption{NLQ Definition and Reader Function}
\label{fig:implementNLQ}
\end{figure}
}

maybe something like this

by the way I am using:
\definecolor{sql}{rgb}{0,0,2.55}
\definecolor{sqlC}{rgb}{0,0.44,0}
\definecolor{BRICKRED}{rgb}{0.57,0.0,0.0}
\definecolor{FORESTGREEN}{rgb}{0.0,0.34,0.0}
\definecolor{GOLDENROD}{rgb}{0.75,0.55,0.0}
\definecolor{VIOLET}{rgb}{.7,0.0,0.05}
\definecolor{MIDBLUE}{rgb}{0.08,0.08,1.28}
for the color

algorithmic,algorithm2eandalgorithmicx. See for example en.wikibooks.org/wiki/LaTeX/Algorithms. – Jana Jan 28 at 7:42{\footnotesize\begin{figure}do\begin{figure}\footnotesize– Martin Schröder Jan 28 at 8:37