diff options
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} |