邻接表图

邻接表图

尝试绘制邻接表(见附件)。有什么建议吗?在此处输入图片描述

答案1

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=latex,x=1.0cm,y=1.0cm]
\fill[line width=2.pt,color=black,fill=white] (0.,0.) -- (1.,0.) -- (1.,1.) -- (0.,1.) -- cycle;
\fill[line width=2.pt,color=black,fill=white] (2.,1.) -- (2.,0.) -- (3.,0.) -- (3.,1.) -- cycle;
\fill[line width=2.pt,color=black,fill=white] (4.,1.) -- (3.,1.) -- (3.,0.) -- (4.,0.) -- cycle;
\fill[line width=2.pt,color=black,fill=white] (4.,1.) -- (4.,0.) -- (5.,0.) -- (5.,1.) -- cycle;
\draw [line width=2.pt,color=black] (0.,0.)-- (1.,0.);
\draw [line width=2.pt,color=black] (1.,0.)-- (1.,1.);
\draw [line width=2.pt,color=black] (1.,1.)-- (0.,1.);
\draw [line width=2.pt,color=black] (0.,1.)-- (0.,0.);
\draw [line width=2.pt,color=black] (2.,1.)-- (2.,0.);
\draw [line width=2.pt,color=black] (2.,0.)-- (3.,0.);
\draw [line width=2.pt,color=black] (3.,0.)-- (3.,1.);
\draw [line width=2.pt,color=black] (3.,1.)-- (2.,1.);
\draw [line width=2.pt,color=black] (4.,1.)-- (3.,1.);
\draw [line width=2.pt,color=black] (3.,0.)-- (4.,0.);
\draw [line width=2.pt,color=black] (4.,0.)-- (4.,1.);
\draw [line width=2.pt,color=black] (4.,0.)-- (5.,0.);
\draw [line width=2.pt,color=black] (5.,0.)-- (5.,1.);
\draw [line width=2.pt,color=black] (5.,1.)-- (4.,1.);
\draw [->,line width=2.pt] (1.,0.5) -- (2.,0.5);
\draw (0.25,.7) node[anchor=north west] {$X$};
\draw (2.25,.7) node[anchor=north west] {$X$};
\draw (3.25,.7) node[anchor=north west] {$X$};
\draw (4.25,.7) node[anchor=north west] {$X$};
\end{tikzpicture}
\end{document}

答案2

你需要 Ti这是 Z 吗?

\documentclass[varwidth,border=7pt]{standalone}
\begin{document}
    $\fbox{x}\rightarrow\fbox{x}\fbox{x}\fbox{x}\fbox{x}$
\end{document}

在此处输入图片描述

相关内容