I have drawn a binary tree using the TikZ-qtree package.
1) I now would like to align captions on the right of tree with each of its level---and I would like the placement to be automatic (ideally I only have to specify that I want it at Xpx from the right border of the tree, and the vertical positioning is taken care of by itself).
2) I would like to be able to draw several brackets in the tree ranging some of the (contiguous) nodes. Ideally, again, I would only specify the nodes, and not have to take care about positioning at all!!
Here is the code I have at the moment:
\documentclass{article}
\usepackage{tikz, pgf}
\usepackage{tikz-qtree}
\def\tn#1{{\bf #1}}
\begin{document}
\begin{tikzpicture}
\Tree [.0
[.0
[.0
[.{\tn 0} ]
[.{\tn 1} ] ]
[.1
[.{\tn 2} ]
[.{\tn 3} ] ] ]
[.1
[.2
[.{\tn 4} ]
[.0
[.{\tn 0} ]
[.{\tn 1} ] ] ]
[.3
[.1
[.{\tn 2} ]
[.{\tn 3} ] ]
[.2
[.{\tn 4} ]
[.0 \edge[roof]; {... } ] ] ] ] ]
\end{tikzpicture}
\end{document}
And here is an illustration of what I aim to do:
Any help much appreciated.