From 3f57a21fe5abf38358e0908498eb6bb07132e21e Mon Sep 17 00:00:00 2001 From: Florian Unger <florian.unger@posteo.net> Date: Wed, 16 Dec 2020 14:51:59 +0100 Subject: [PATCH] added a few pictures --- bilder/heap_array_representation.tex | 20 ++++++++++++++++++++ bilder/heap_tree_representation.tex | 27 +++++++++++++++++++++++++++ bilder/heapsort_1.tex | 26 ++++++++++++++++++++++++++ bilder/heapsort_2.tex | 20 ++++++++++++++++++++ bilder/heapsort_3.tex | 20 ++++++++++++++++++++ bilder/heapsort_4.tex | 20 ++++++++++++++++++++ bilder/heapsort_5.tex | 20 ++++++++++++++++++++ bilder/heapsort_6.tex | 26 ++++++++++++++++++++++++++ 8 files changed, 179 insertions(+) create mode 100644 bilder/heap_array_representation.tex create mode 100644 bilder/heap_tree_representation.tex create mode 100644 bilder/heapsort_1.tex create mode 100644 bilder/heapsort_2.tex create mode 100644 bilder/heapsort_3.tex create mode 100644 bilder/heapsort_4.tex create mode 100644 bilder/heapsort_5.tex create mode 100644 bilder/heapsort_6.tex diff --git a/bilder/heap_array_representation.tex b/bilder/heap_array_representation.tex new file mode 100644 index 0000000..f702eed --- /dev/null +++ b/bilder/heap_array_representation.tex @@ -0,0 +1,20 @@ +\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} diff --git a/bilder/heap_tree_representation.tex b/bilder/heap_tree_representation.tex new file mode 100644 index 0000000..84da683 --- /dev/null +++ b/bilder/heap_tree_representation.tex @@ -0,0 +1,27 @@ +\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} diff --git a/bilder/heapsort_1.tex b/bilder/heapsort_1.tex new file mode 100644 index 0000000..5264a6b --- /dev/null +++ b/bilder/heapsort_1.tex @@ -0,0 +1,26 @@ +\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} + + + diff --git a/bilder/heapsort_2.tex b/bilder/heapsort_2.tex new file mode 100644 index 0000000..1b330e1 --- /dev/null +++ b/bilder/heapsort_2.tex @@ -0,0 +1,20 @@ +\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} + + + diff --git a/bilder/heapsort_3.tex b/bilder/heapsort_3.tex new file mode 100644 index 0000000..f0187ae --- /dev/null +++ b/bilder/heapsort_3.tex @@ -0,0 +1,20 @@ +\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} + + + diff --git a/bilder/heapsort_4.tex b/bilder/heapsort_4.tex new file mode 100644 index 0000000..d4e0cee --- /dev/null +++ b/bilder/heapsort_4.tex @@ -0,0 +1,20 @@ +\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} + + + diff --git a/bilder/heapsort_5.tex b/bilder/heapsort_5.tex new file mode 100644 index 0000000..ddec3e9 --- /dev/null +++ b/bilder/heapsort_5.tex @@ -0,0 +1,20 @@ +\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} + + + diff --git a/bilder/heapsort_6.tex b/bilder/heapsort_6.tex new file mode 100644 index 0000000..d79361f --- /dev/null +++ b/bilder/heapsort_6.tex @@ -0,0 +1,26 @@ +\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} + + + -- GitLab