aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kapp Lindquist <andkaplin05@gmail.com>2025-10-28 11:34:50 +0100
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commit11f9175014e6a40263c8b3d417bbcc287ee1fa1b (patch)
tree1e6c5d24a71ca2e794f92f0370815a694ce7634f
parent3bc255f9677175e8a701ea365ffcc97080160ff9 (diff)
downloadsorter-11f9175014e6a40263c8b3d417bbcc287ee1fa1b.tar.gz
sorter-11f9175014e6a40263c8b3d417bbcc287ee1fa1b.zip
report(implementation): Quicksort and Insertionsort plot
-rw-r--r--report/report.tex34
1 files changed, 21 insertions, 13 deletions
diff --git a/report/report.tex b/report/report.tex
index bf293b5..5b252ba 100644
--- a/report/report.tex
+++ b/report/report.tex
@@ -9,6 +9,9 @@
\usepackage{siunitx}
\usepackage{algorithm2e}
\usepackage{float}
+\usepackage{caption}
+\usepackage{subcaption}
+
\geometry{a4paper}
\begin{document}
@@ -246,19 +249,24 @@ output from the \textit{builtin} function \textit{sort}.
Given all of the tests pass, we can then run \textit{benchmark.sh}, which times
how long it takes for out program to run with each test file, and saves the
result in a \textit{csv} file.
+
\begin{figure}[H]
\centering
\begin{tikzpicture}
+
\begin{axis}[
xlabel={size},
ylabel={seconds},
- % xmode=log,
- % ymode=log,
+ ymode=log,
+ width=\textwidth,
legend pos=north west,
scatter/classes={
- random={mark=*,red},
- reverse={mark=*,green},
- sorted={mark=*,blue}
+ isort_random={mark=*,red},
+ isort_reverse={mark=*,green},
+ isort_sorted={mark=*,blue},
+ qsort_random={mark=*,cyan},
+ qsort_reverse={mark=*,magenta},
+ qsort_sorted={mark=*,yellow}
}
]
@@ -268,20 +276,20 @@ result in a \textit{csv} file.
]
table [x=size, y=real, meta=type, col sep=comma]
{../test/benchmark_results.csv};
- \legend{random, reverse, sorted}
+ \legend{isort\_random, isort\_reverse, isort\_sorted, qsort\_random, qsort\_reverse, qsort\_sorted}
- \addplot[domain=100:100000, samples=10, thick, densely dotted, black]{x/250000};
- \addlegendentry{$\mathcal O(\text{size})$}
+ % \addplot[domain=100:100000, samples=10, thick, densely dotted, black]{x/250000};
+ % \addlegendentry{$\mathcal O(\text{size})$}
+ %
+ % \addplot[domain=100:100000, samples=10, thick, dashed, black]{(x*x)/4000000000};
+ % \addlegendentry{$\mathcal O(\text{size}^2)$}
- \addplot[domain=100:100000, samples=10, thick, dashed, black]{(x*x)/4000000000};
-
- \addlegendentry{$\mathcal O(\text{size}^2)$}
\end{axis}
\end{tikzpicture}
- \caption{Benchmarking of Insertion-sort with random data, reversely sorted
- data, and sorted data.}
+ \caption{}\label{fig:}
\end{figure}
+
\section{Conclusion}
\end{document}