-2

Is there a way to create something that looks like this?

Hashtable and hashfunction (red)

  • 5
    What have you tried so far? How do you want the macro syntax to be? – user156344 May 4 '19 at 23:05
5

Quick proposal. Defining a new macro if needed is your job.

\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[
    bigbox/.style={draw,minimum height=1cm,minimum width=1.5cm},
    smallbox/.style={draw,minimum height=.75cm,minimum width=1.5cm,font=\color{green}},
    labelbox/.style={font=\color{red}}
]
    \node[bigbox] (59) {59};
    \node[bigbox,below=of 59] (85) {85};
    \node[smallbox,right=of 59] (e) {$e$};
    \node[smallbox,right=of 85] (e2) {$e_2$};
    \path[labelbox] (59.west) node[left] {59} (85.west) node[left] {85};
    \draw[->] (59) edge (e) (85) edge (e2);
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.