-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplots.Rnw
85 lines (77 loc) · 3.19 KB
/
plots.Rnw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
\documentclass[11pt]{article}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
%\usepackage{color}
\usepackage[usenames,dvipsnames,x11names,table]{xcolor}
\begin{document}
\setkeys{Gin}{width=\textwidth}
Na wszystkich wykresach poniżej zastosowano następującą kolorystykę:
\begin{itemize}
\item \textcolor{black}{sortowanie przez wybór}
\item \textcolor{red}{sortowanie przez wstawianie}
\item \textcolor{Green}{sortowanie Shell'a}
\item \textcolor{blue}{sortowanie przez kopcowanie}
\item \textcolor{Gold4}{quicksort z wyborem pierwszego elementu}
\item \textcolor{orange}{quicksort z wyborem losowego elementu}
\end{itemize}
\section{Losowe}
<<echo=FALSE,fig=TRUE>>=
selection <- read.table('out/random_selection')
insertion <- read.table('out/random_insertion')
shell <- read.table('out/random_shell')
heap <- read.table('out/random_heap')
quick_left <- read.table('out/random_quick_left')
quick_rand <- read.table('out/random_quick_rand')
plot(selection, type = 'l', log = 'y', xlab = 'Ilość elementów', ylab = 'Czas', yaxt = 'n', ylim = range(1e7:3e8))
lines(insertion, col = 'red')
lines(shell, col = 'chartreuse4')
lines(heap, col = 'blue')
lines(quick_left,col = 'gold4')
lines(quick_rand,col = 'orange')
@
\section{Posortowane}
<<echo=FALSE,fig=TRUE>>=
selection <- read.table('out/sorted_selection')
insertion <- read.table('out/sorted_insertion')
shell <- read.table('out/sorted_shell')
heap <- read.table('out/sorted_heap')
quick_left <- read.table('out/sorted_quick_left')
quick_rand <- read.table('out/sorted_quick_rand')
plot(selection, type = 'l', log = 'y', xlab = 'Ilość elementów', ylab = 'Czas', yaxt = 'n', ylim = range(1e7:3e8))
lines(insertion, col = 'red')
lines(shell, col = 'chartreuse4')
lines(heap, col = 'blue')
lines(quick_left,col = 'gold4')
lines(quick_rand,col = 'orange')
@
\section{Odwrotnie posortowane}
<<echo=FALSE,fig=TRUE>>=
selection <- read.table('out/reversed_selection')
insertion <- read.table('out/reversed_insertion')
shell <- read.table('out/reversed_shell')
heap <- read.table('out/reversed_heap')
quick_left <- read.table('out/reversed_quick_left')
quick_rand <- read.table('out/reversed_quick_rand')
plot(selection, type = 'l', log = 'y', xlab = 'Ilość elementów', ylab = 'Czas', yaxt = 'n', ylim = range(1e7:3e8))
lines(insertion, col = 'red')
lines(shell, col = 'chartreuse4')
lines(heap, col = 'blue')
lines(quick_left,col = 'gold4')
lines(quick_rand,col = 'orange')
@
\section{V kształtne}
<<echo=FALSE,fig=TRUE>>=
selection <- read.table('out/vshaped_selection')
insertion <- read.table('out/vshaped_insertion')
shell <- read.table('out/vshaped_shell')
heap <- read.table('out/vshaped_heap')
quick_left <- read.table('out/vshaped_quick_left')
quick_rand <- read.table('out/vshaped_quick_rand')
plot(selection, type = 'l', log = 'y', xlab = 'Ilość elementów', ylab = 'Czas', yaxt = 'n', ylim = range(1e7:3e8))
lines(insertion, col = 'red')
lines(shell, col = 'chartreuse4')
lines(heap, col = 'blue')
lines(quick_left,col = 'gold4')
lines(quick_rand,col = 'orange')
@
\end{document}