I tried to write a code which provides the simplest interface:
\begin{tikzpicture}
\foreach \index/\list in {1/{a,b,null}, 2/{c,null}, 3/{d,null}} {
\node[array element] (aux) at (0,-\index) {\index};
\LinkedList{\list}
}
\end{tikzpicture}

This is the complete source code:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\usetikzlibrary{positioning}
\tikzset{
node of list/.style = {
draw,
fill=orange!20,
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=ele] {\element};
\draw[link] (aux) -- (ele);
\coordinate (aux) at (ele.east);
}
}
\begin{tikzpicture}
\foreach \index/\list in {1/{a,b,null}, 2/{c,null}, 3/{d,null}} {
\node[array element] (aux) at (0,-\index) {\index};
\LinkedList{\list}
}
\end{tikzpicture}
\end{document}
However, the above is not the standard way of representing linked lists. I prefer this one instead:

Which is obtained simply replacing the definition of \LinkedList above with this one:
\def\LinkedList#1{%
\foreach \element in \list {
\node[node of list, right = of aux, name=ele] {\element};
\node[node of list, name=aux2, anchor=west] at ([xshift=-.4pt] ele.east) {};
\draw[link] (aux) -- (ele);
\coordinate (aux) at (aux2);
}
\fill (aux) circle(2pt);
}
and removing the null element in the list specification, i.e. the main loop is now:
\foreach \index/\list in {1/{a,b}, 2/{c}, 3/{d}} {
A small addition, if future readers need this kind of behavior:
\foreach [count=\i] \index/\list in {1/{a,b}, 20/{c}, 50/{d}} {
\node[array element] (aux) at (0,-\i) {\index};
\LinkedList{\list}
}
outputs the linked list with only the needed array cells rendered, eg.

\linkedlist{1={a,b,null},2={c,null},3={d,null}}and the output should be automated? – Werner Dec 12 '12 at 22:53