I basically want to draw Skip Lists like this (without the blue arrows) Skiplist

I didn't find any examples that look like this on the internet

  • 1
    You can use a matrix or chains. If you post something that spares others from punching in the numbers you may be getting more and quicker answers.
    – user229669
    Dec 1, 2020 at 14:09

1 Answer 1

\begin{tikzpicture}[box/.style={on chain,draw,minimum width=1.5em,
    text=green!60!black,join=by abc},
    c/.style={on chain,circle,draw,inner sep=1ex},
    node distance=1.5em,abc/.style={stealth-}]
 \path[abc/.style={-stealth},start chain=going right,nodes={alias=1-\X}]
  foreach \X in {0,1,5,6,8,12,17,22,33,40,44,47} {\ifnum\X=0
 \begin{scope}[start branch=b0 going above] 
 \begin{scope}[start branch=b6 going above] 
 \begin{scope}[start branch=b6 going above] 
 \begin{scope}[start branch=b17 going above] 
 \begin{scope}[start branch=b40 going above] 
 \path foreach \X in {1,2,3} {(\X-0) node[left=1em]{$h=\X$}};
 \path[every edge/.append style={-stealth}] (2-0) edge (2-6) edge (1-0)
  (3-0) edge (2-0) edge (3-40)
  (2-6) edge (2-17) (2-17) edge (2-40);

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .