-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
200 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
\workinprogress % TODO | ||
See \refFigure{6.4-1}. | ||
\begin{figure}[htb] | ||
\hspace*{-1.5cm} | ||
\begin{minipage}{\textwidth + 1.5cm} | ||
\captionsetup[subfigure]{} | ||
\subcaptionbox{\label{fig:6.4-1a}}[0.33\textwidth]{\input{1a.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1b}}[0.33\textwidth]{\input{1b.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1c}}[0.33\textwidth]{\input{1c.tikz}} | ||
\par\vspace{3ex} | ||
\subcaptionbox{\label{fig:6.4-1d}}[0.33\textwidth]{\input{1d.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1e}}[0.33\textwidth]{\input{1e.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1f}}[0.33\textwidth]{\input{1f.tikz}} | ||
\par\vspace{3ex} | ||
\subcaptionbox{\label{fig:6.4-1g}}[0.33\textwidth]{\input{1g.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1h}}[0.33\textwidth]{\input{1h.tikz}} | ||
\subcaptionbox{\label{fig:6.4-1i}}[0.33\textwidth]{\input{1i.tikz}} | ||
\par\vspace{3ex} | ||
\subcaptionbox{\label{fig:6.4-1j}}[0.33\textwidth]{\input{1j.tikz}} | ||
\end{minipage} | ||
\caption{The operation of \proc{Heapsort} on the array $A=\langle$5, 13, 2, 25, 7, 17, 20, 8, 4$\rangle$.\, | ||
\textbf{(a)}\, The max-heap built by \proc{Build-Max-Heap} in line 1.\, | ||
\textbf{(b)--(i)}\, The max-heap and the nodes removed from it after each call to \proc{Max-Heapify} in line 5.\, | ||
\textbf{(j)}\, The resulting sorted array $A$.} \label{fig:6.4-1} | ||
\end{figure} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\setlength{\vertexsize}{1.1em} | ||
\tikzset{ | ||
every node/.style = {light blue vertex}, | ||
discarded/.style = {tan vertex}, | ||
every label/.style = {index}, | ||
level/.append style = {sibling distance=5\vertexsize/#1}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {25} | ||
child {node {13} | ||
child {node {8} | ||
child {node {5}} | ||
child {node {4}} | ||
} | ||
child {node {7}} | ||
} | ||
child {node {20} | ||
child {node {17}} | ||
child {node {2} | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {20} | ||
child {node {13} | ||
child {node {8} | ||
child {node {5}} | ||
child {node[discarded, label=right:{$i$}] {25} edge from parent[draw=none]} | ||
} | ||
child {node {7}} | ||
} | ||
child {node {17} | ||
child {node {4}} | ||
child {node {2} | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {17} | ||
child {node {13} | ||
child {node {8} | ||
child {node[discarded, label=left:{$i$}] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node {7}} | ||
} | ||
child {node {5} | ||
child {node {4}} | ||
child {node {2} | ||
child[missing] | ||
child {node[draw=none, fill=none, label=right:{}] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {13} | ||
child {node {8} | ||
child {node {2} | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node {7}} | ||
} | ||
child {node {5} | ||
child {node {4}} | ||
child {node[discarded, label=left:{$i$}] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {8} | ||
child {node {7} | ||
child {node {2} | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node {4}} | ||
} | ||
child {node {5} | ||
child {node[discarded, label=left:{$i$}] {13} edge from parent[draw=none]} | ||
child {node[discarded] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {7} | ||
child {node {4} | ||
child {node {2} | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node[discarded, label=left:{$i$}] {8} edge from parent[draw=none]} | ||
} | ||
child {node {5} | ||
child {node[discarded] {13} edge from parent[draw=none]} | ||
child {node[discarded] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {5} | ||
child {node {4} | ||
child {node[discarded, label=left:{$i$}] {7} edge from parent[draw=none] | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node[discarded] {8} edge from parent[draw=none]} | ||
} | ||
child {node {2} | ||
child {node[discarded] {13} edge from parent[draw=none]} | ||
child {node[discarded] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {4} | ||
child {node {2} | ||
child {node[discarded] {7} edge from parent[draw=none] | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node[discarded] {8} edge from parent[draw=none]} | ||
} | ||
child {node[discarded, label=left:{$i$}] {5} edge from parent[draw=none] | ||
child {node[discarded] {13} edge from parent[draw=none]} | ||
child {node[discarded] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture} | ||
\node {2} | ||
child {node[discarded, label=left:{$i$}] {4} edge from parent[draw=none] | ||
child {node[discarded] {7} edge from parent[draw=none] | ||
child {node[discarded] {20} edge from parent[draw=none]} | ||
child {node[discarded] {25} edge from parent[draw=none]} | ||
} | ||
child {node[discarded] {8} edge from parent[draw=none]} | ||
} | ||
child {node[discarded] {5} edge from parent[draw=none] | ||
child {node[discarded] {13} edge from parent[draw=none]} | ||
child {node[discarded] {17} edge from parent[draw=none] | ||
child[missing] | ||
child {node[draw=none, fill=none] {} edge from parent[draw=none]} | ||
} | ||
}; | ||
\end{tikzpicture} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\input{1.tikz} | ||
\begin{tikzpicture}[ | ||
every node/.style = {}, | ||
] | ||
\matrix[array, row 1/.append style={nodes={fill=tan}}, label=left:{$A$}] { | ||
2 & 4 & 5 & 7 & 8 & 13 & 17 & 20 & 25 \\}; | ||
\end{tikzpicture} |