Skip to content
Snippets Groups Projects
Commit 3f57a21f authored by Florian Unger's avatar Florian Unger
Browse files

added a few pictures

parent 6f7b21ad
Branches
No related tags found
No related merge requests found
\tikzsetnextfilename{heap_array_representation}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm}]
\node [common] (k_0) {$5$}
child {node [common] (k_1) {$7$}
child {node [common] (k_3) {$1$}}
child {node [common] (k_4) {$8$}}
}
child {node [common] (k_2) {$3$}
child {node [common] (k_5) {$2$}}
}
;
\node [above left = 0.1mm of k_0] (l_0) {$\scriptstyle{0}$};
\node [above left = 0.1mm of k_1] (l_1) {$\scriptstyle{1}$};
\node [above right = 0.1mm of k_2] (l_2) {$\scriptstyle{2}$};
\node [above left = 0.1mm of k_3] (l_3) {$\scriptstyle{3}$};
\node [above right = 0.1mm of k_4] (l_4) {$\scriptstyle{4}$};
\node [above left = 0.1mm of k_5] (l_5) {$\scriptstyle{5}$};
\end{tikzpicture}
\tikzsetnextfilename{heap_tree_representation}
\begin{tikzpicture}[
level/.style={sibling distance=35mm/#1},
common/.style={circle, draw, minimum size=7mm}]
\node [common] (k_0) {$9$}
child {node [common] (k_1) {$7$}
child {node [common] (k_3) {$4$}
child {node [common] (k_7) {$0$}}
child[missing] {node (e) {}}
}
child {node [common] (k_4) {$1$}}
}
child {node [common] (k_2) {$8$}
child {node [common] (k_5) {$3$}}
child {node [common] (k_6) {$2$}}
}
;
\node [above left = -0.8mm of k_0] (l_0) {$\scriptscriptstyle{\mathcal{A}[0]}$};
\node [above left = -0.8mm of k_1] (l_1) {$\scriptscriptstyle{\mathcal{A}[1]}$};
\node [above right = -0.8mm of k_2] (l_2) {$\scriptscriptstyle{\mathcal{A}[2]}$};
\node [above left = -0.8mm of k_3] (l_3) {$\scriptscriptstyle{\mathcal{A}[3]}$};
\node [above right = -0.8mm of k_4] (l_4) {$\scriptscriptstyle{\mathcal{A}[4]}$};
\node [above left = -0.8mm of k_5] (l_5) {$\scriptscriptstyle{\mathcal{A}[5]}$};
\node [above right = -0.8mm of k_6] (l_6) {$\scriptscriptstyle{\mathcal{A}[6]}$};
\node [above left = -0.8mm of k_7] (l_7) {$\scriptscriptstyle{\mathcal{A}[7]}$};
\end{tikzpicture}
\tikzsetnextfilename{heapsort_1}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [common] (k_0) {$5$}
child {node [common] (k_1) {$7$}
child {node [shaded] (k_3) {$1$}}
child {node [shaded] (k_4) {$8$}}
}
child {node [common] (k_2) {$3$}
child {node [shaded] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\node [above left = -0.8mm of k_0] (l_0) {$\scriptscriptstyle{\mathcal{A}[0]}$};
\node [above left = -0.8mm of k_1] (l_1) {$\scriptscriptstyle{\mathcal{A}[1]}$};
\node [above right = -0.8mm of k_2] (l_2) {$\scriptscriptstyle{\mathcal{A}[2]}$};
\node [above left = -0.8mm of k_3] (l_3) {$\scriptscriptstyle{\mathcal{A}[3]}$};
\node [above right = -0.8mm of k_4] (l_4) {$\scriptscriptstyle{\mathcal{A}[4]}$};
\node [above left = -0.8mm of k_5] (l_5) {$\scriptscriptstyle{\mathcal{A}[5]}$};
\end{tikzpicture}
\tikzsetnextfilename{heapsort_2}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [common] (k_0) {$5$}
child {node [common] (k_1) {$7$}
child {node [common] (k_3) {$1$}}
child {node [common] (k_4) {$8$}}
}
child {node [shaded] (k_2) {$3$}
child {node [shaded] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\end{tikzpicture}
\tikzsetnextfilename{heapsort_3}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [common] (k_0) {$5$}
child {node [shaded] (k_1) {$7$}
child {node [shaded] (k_3) {$1$}}
child {node [shaded] (k_4) {$8$} edge from parent[<->, thick]}
}
child {node [common] (k_2) {$3$}
child {node [common] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\end{tikzpicture}
\tikzsetnextfilename{heapsort_4}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [shaded] (k_0) {$5$}
child {node [shaded] (k_1) {$8$} edge from parent[<->, thick]
child {node [common] (k_3) {$1$} edge from parent[-, thin]}
child {node [common] (k_4) {$7$} edge from parent[-, thin]}
}
child {node [shaded] (k_2) {$3$}
child {node [common] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\end{tikzpicture}
\tikzsetnextfilename{heapsort_5}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [common] (k_0) {$8$}
child {node [shaded] (k_1) {$5$}
child {node [shaded] (k_3) {$1$}}
child {node [shaded] (k_4) {$7$} edge from parent[<->, thick]}
}
child {node [common] (k_2) {$3$}
child {node [common] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\end{tikzpicture}
\tikzsetnextfilename{heapsort_6}
\begin{tikzpicture}[
level/.style={sibling distance=30mm/#1},
common/.style={circle, draw, minimum size=7mm},
shaded/.style={common, fill=gray!50}
]
\node [common] (k_0) {$8$}
child {node [common] (k_1) {$7$}
child {node [shaded] (k_3) {$1$}}
child {node [shaded] (k_4) {$5$}}
}
child {node [common] (k_2) {$3$}
child {node [shaded] (k_5) {$2$}}
child[missing] {node (e) {}}
}
;
\node [above left = -0.8mm of k_0] (l_0) {$\scriptscriptstyle{\mathcal{A}[0]}$};
\node [above left = -0.8mm of k_1] (l_1) {$\scriptscriptstyle{\mathcal{A}[1]}$};
\node [above right = -0.8mm of k_2] (l_2) {$\scriptscriptstyle{\mathcal{A}[2]}$};
\node [above left = -0.8mm of k_3] (l_3) {$\scriptscriptstyle{\mathcal{A}[3]}$};
\node [above right = -0.8mm of k_4] (l_4) {$\scriptscriptstyle{\mathcal{A}[4]}$};
\node [above left = -0.8mm of k_5] (l_5) {$\scriptscriptstyle{\mathcal{A}[5]}$};
\end{tikzpicture}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment