Hope your all keeping well under the circumstances.
I'd like a bit of help creating the following factor tree in the shown format. Try as I might, I'm getting a bit overwhelmed by the apparent possible complexity of it all! Thanks in advance

NEW: TikZ book now 40% off at Amazon.com for a short time.
Code: Select all
\documentclass[a4paper,landscape]{scrartcl}
\usepackage{fancybox}
\usepackage{tikz}
\title{MergeSort-RecursionTree}
\author{Manuel Kirsch}
\date{}
\begin{document}
\begin{tikzpicture}[level/.style={sibling distance=60mm/#1}]
\node {3780}
child {node [circle,draw] {2}
}
child {node{1890}
child {node [circle,draw] {2}
}
child {node {945}
child {node [circle,draw] {3}
}
child {node {315}
child {node [circle,draw] {3}
}
child {node {105}
child {node [circle,draw] {3}
}
child {node {35}
child {node [circle,draw] {3}
}
child [grow=right] {node (q) {$=$} edge from parent[draw=none]
child [grow=right] {node (q) {$O_{k = \lg n}(n)$} edge from parent[draw=none]
child [grow=up] {node (r) {$\vdots$} edge from parent[draw=none]
child [grow=up] {node (s) {$O_2(n)$} edge from parent[draw=none]
child [grow=up] {node (t) {$O_1(n)$} edge from parent[draw=none]
child [grow=up] {node (u) {$O_0(n)$} edge from parent[draw=none]}
}
}
}
child [grow=down] {node (v) {$O(n \cdot \lg n)$}edge from parent[draw=none]}
}
}
}
}
}
};
\end{tikzpicture}
\end{document}
Code: Select all
\documentclass[tikz, border=5pt]{standalone}
\begin{document}
\begin{tikzpicture}[
circled/.style={draw, circle}
]
\node {3780}
child {node [circled] {2}}
child {node{1890}
child {node [circled] {2}}
child {node {945}
child {node [circled] {3}}
child {node {315}
child {node [circled] {3}}
child {node {105}
child {node [circled] {3}}
child {node {35}
child {node [circled] {3}}
child {node [circled] {7}}
}
}
}
}
};
\end{tikzpicture}
\end{document}
Code: Select all
\documentclass[border=5pt, preview]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
if n children=0{draw, circle}{},
s sep*=3,
l sep*=2
}
[3780
[2]
[1890
[2]
[945
[3]
[315
[3]
[105
[3]
[35
[3]
[7]
]
]
]
]
]
]
\end{forest}
\end{document}
\resizebox
\scalebox
orscale
and transform shape
of the tikzpicture
environmentCode: Select all
\makeatletter
\preto\forest@pack{\nullfont}
\makeatother
\scalebox
when not using the forest option?Code: Select all
\documentclass[tikz, border=5pt]{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\scalebox{1.5}
\begin{tikzpicture}[
circled/.style={draw, circle}
]
\node {3780}
child {node [circled] {2}}
child {node{1890}
child {node [circled] {2}}
child {node {945}
child {node [circled] {3}}
child {node {315}
child {node [circled] {3}}
child {node {105}
child {node [circled] {3}}
child {node {35}
child {node [circled] {3}}
child {node [circled] {7}}
}
}
}
}
};
\end{tikzpicture}}
\end{document}
\scalebox
command. Make sure that all required braces have been set.NEW: TikZ book now 40% off at Amazon.com for a short time.