diff options
| author | Andreas Kapp Lindquist <andkaplin05@gmail.com> | 2025-10-24 13:27:33 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | e7fac2e4ef4545b4355f15f3aca0dd75f2a7a6b9 (patch) | |
| tree | 7ab60b0d99d26e5ef8af9b004e8c499d4ddd6512 /report/report.tex | |
| parent | 0baf9af6e2e150a17b96366441310b8080929277 (diff) | |
| download | sorter-e7fac2e4ef4545b4355f15f3aca0dd75f2a7a6b9.tar.gz sorter-e7fac2e4ef4545b4355f15f3aca0dd75f2a7a6b9.zip | |
report(evaluation): Benchmarking figure for insertionsort
Diffstat (limited to 'report/report.tex')
| -rw-r--r-- | report/report.tex | 41 |
1 files changed, 35 insertions, 6 deletions
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} |