From e7fac2e4ef4545b4355f15f3aca0dd75f2a7a6b9 Mon Sep 17 00:00:00 2001 From: Andreas Kapp Lindquist Date: Fri, 24 Oct 2025 13:27:33 +0200 Subject: report(evaluation): Benchmarking figure for insertionsort --- report/report.tex | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'report/report.tex') diff --git a/report/report.tex b/report/report.tex index 82e78af..e2fa3ed 100644 --- a/report/report.tex +++ b/report/report.tex @@ -150,12 +150,41 @@ addresses around. \item Benchmark insertion-sort vs. quick-sort unsorted data \end{itemize} -\begin{tikzpicture} - \begin{axis}[xlabel={size},ylabel={seconds}] - \addplot[only marks] table [x=size, y=real, col sep=comma] - {../benchmark_results.csv}; - \end{axis} -\end{tikzpicture} +\begin{figure}[H] + \centering + \begin{tikzpicture} + \begin{axis}[ + xlabel={size}, + ylabel={seconds}, + % xmode=log, + % ymode=log, + legend pos=north west, + scatter/classes={ + random={mark=*,red}, + reverse={mark=*,green}, + sorted={mark=*,blue} + } + ] + + \addplot[ + scatter, only marks, + scatter src=explicit symbolic + ] + table [x=size, y=real, meta=type, col sep=comma] + {../test/benchmark_results.csv}; + \legend{random, reverse, 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, 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.} +\end{figure} \section{Conclusion} -- cgit v1.2.3-70-g09d2