Suppose we want to draw recursion tree of T(n)=T(n/4)+T(n/2)+n^2
using Justtree package that introduced here (justtree.sty).
I try as follows:
\begin{justtree}
{
declare count={tree n}{1},
just format={xshift=1.5em},
annotate/.style={% style should be applied to the rightmost node at each level for which an arrow and annotation is required
if n children=0{}{
right just=$n^2$,
},
},
where n children=0{
edge={dotted},
}{},
for tree={
math content,
if level=0{}{%
if level=1{%
tree n'=1,
}{%
if n=1{%
tree n/.wrap pgfmath arg={#1}{tree_n("!u")},
}{%
tree n/.wrap pgfmath arg={#1}{int((tree_n("!u"))},
},
},
},
delay={
if level=1{
content=n^2,
tikz+={
\draw [<->] (!F.south west) +(-2.5em,0) coordinate (c) -- (.north -| c) node [midway, anchor=south, sloped] {$\log_{\frac{4}{3}}n$};
}
,
}{
if n children=0{%
}{
if level=0{}{
content/.wrap 2 pgfmath args={(\frac{#1n}{#2})^2}{(tree_n()==1) ? "" : (tree_n())}{int(4^(level("!u")))},
}
}
}
},
},
}
[, annotate
[
[
[[][]]
[[][]]
]
[
[[][]]
[[][]]
]
]
[, annotate
[
[[][]]
[[][]]
]
[, annotate
[, annotate[][]]
[[][]]
]
]
]
\end{justtree}
Unfortunately, above code draws a recursion tree for T(n)=T(n/4)+T(3n/4)+n^2
Could someone help me to modify the above code to achieve my goal?