Como desenhar a imagem cheia de arrays

Como desenhar a imagem cheia de arrays

Não sei como fazer a imagem abaixo.

insira a descrição da imagem aqui

veja meu código

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
  \begin{tikzpicture}
    \coordinate (s) at (0,0);
    \foreach \num in {5,2,7,-5,16,12}{
      \node[minimum size=6mm, draw, rectangle] at (s) {\num};
      \coordinate (s) at ($(s) + (1,0)$);
    }
  \end{tikzpicture}
\end{document}

Pergunta : Como desenhar a imagem dada no diagrama?

Responder1

O código a seguir (que é fortemente inspirado emA resposta de Gonzalo Medina) pode servir como ponto de partida:

insira a descrição da imagem aqui

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning,arrows.meta,arrows}

\tikzset{
mymat/.style={
  matrix of math nodes,
  text height=2.5ex,
  text depth=0.75ex,
  text width=3.25ex,
  align=center,
  row sep=-\pgflinewidth
  },
}
\begin{document}

\begin{tikzpicture}[>=latex]
\matrix[mymat,anchor=west,style={nodes=draw}]
at (0,0) 
(mat1)
{
1\\
2\\
3\\
4\\
5\\
6\\
7\\
};
\matrix[mymat,right=of mat1,anchor=south,style={nodes={draw}},yshift=1.5cm]
(mat2)
{
1\\
2\\
};
\matrix[mymat,right=of mat2,anchor=center,style={nodes={draw}}]
(mat3)
{
1\\
2\\
};
\matrix[mymat,right=of mat3,anchor=center,style={nodes={draw}}]
(mat4)
{
1\\
2\\
};
\matrix[mymat,right=of mat1,anchor=north,style={nodes={draw}},yshift=-1.5cm]
(mat5)
{
1\\
2\\
};
\matrix[mymat,right=of mat5,anchor=center,style={nodes={draw}}]
(mat6)
{
1\\
2\\
};
\matrix[mymat,right=of mat6,anchor=center,style={nodes={draw}}]
(mat7)
{
1\\
2\\
};
\path[->]
  (mat1-1-1.center) edge[bend left=50] node [left] {} (mat2-1-1.north west);
\path[->]
  (mat1-1-1.center) edge[bend left=60] node [left] {} (mat3-1-1.north west);
\path[->]
  (mat1-1-1.center) edge[bend left=70] node [left] {} (mat4-1-1.north west);
\path[->]
  (mat1-7-1.center) edge[bend left=50] node [left] {} (mat5-1-1.north west);
\path[->]
  (mat1-7-1.center) edge[bend left=60] node [left] {} (mat6-1-1.north west);
\path[->]
  (mat1-7-1.center) edge[bend left=70] node [left] {} (mat7-1-1.north west);
\end{tikzpicture}

\end{document}

informação relacionada