答案1
这样的树可以用 来生产forest
。
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
for tree={draw,fill=gray!20,s sep+=6ex,l sep+=2ex,math content,
edge={stealth-,very thick,shorten >=3pt,shorten <=3pt},
where n children={0}{}{label={[yshift=-2.5ex,font=\small\sffamily]below:merge}}}
[{1~~2~~2~~3~~4~~5~~6~~6}
[{2~~4~~5~~6}
[{2~~5}
[5]
[2]
]
[{4~~6}
[4]
[6]
]
]
[{1~~2~~3~~6}
[{1~~3}
[1]
[3]
]
[{2~~6}
[2]
[6]
]
]
]
\path (current bounding box.north) node[above=0.5ex] {sorted sequence}
(current bounding box.south) node[below=0.5ex] {initial sequence};
\end{forest}
\end{document}