adjacency_list
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows, shapes, positioning}
\tikzset{
node of list/.style = {
draw,
minimum height=6mm,
minimum width=6mm,
node distance=6mm
},
link/.style = {
-stealth,
shorten >=1pt
},
array element/.style = {
draw, fill=white,
minimum width = 6mm,
minimum height = 10mm
}
}
\def\LinkedList#1{%
\foreach \element in \list {
\node[node of list, right = of aux, name=\element] {\element};
\node[node of list, name=aux2, anchor=west] at ([xshift=-.4pt] \element.east) {};
\draw[link] (aux) -- (\element);
%\coordinate (aux) at (\element.east);
\coordinate (aux) at (aux2);
}
\fill (aux) circle(2pt);
}
\begin{document}
\begin{tikzpicture}
\foreach [count=\i] \index/\list in {$v_{0}$/{$v_{1}$}, $v_{1}$/{$v_{0}$,$v_{2}$,$v_{3}$,$v_{4}$}, $v_{2}$/{$v_{1}$,$v_{3}$,$v_{4}$}, $v_{3}$/{$v_{1}$, $v_{2}$}, $v_{4}$/{$v_{1}$,$v_{2}$}} {
\node[array element] (aux) at (0,-\i) {\index};
\LinkedList{\list}
}
\end{tikzpicture}
\end{document}