Skip to content

Commit 0cb15f2

Browse files
committed
<feat> extended analysis to 10^6 inputs
1 parent 590a220 commit 0cb15f2

8 files changed

+48
-28
lines changed

analisis/.RData

87 Bytes
Binary file not shown.

analisis/.Rhistory

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,19 @@ points(log10(C$n), log10(C$`duration(ns)`), col="green", pch=20, type = "b")
396396
points(log10(CE$n), log10(CE$`duration(ns)`), col="pink", pch=20, type = "b")
397397
points(log10(I$n), log10(I$`duration(ns)`), col="blue", pch=20, type="b")
398398
legend("topleft", col=c("red", "blue", "green", "pink"), legend=c("Selection sort", "Intro sort", "Counting sort", "Counting sort extended"), lty=1)
399+
library(readr)
400+
library(ggplot2)
401+
C <- read_csv("counting_sort.csv")
402+
I <- read_csv("intro_sort.csv")
403+
S <- read_csv("selection_sort.csv")
404+
CE <- read_csv("counting_sort_extended.csv")
405+
plot(log10(S$n), log10(S$`duration(ns)`), col="red", main="Tiempo de ejecución vs. tamaño de entrada (escala logarítmica)", xlab="log(n)", ylab="log(Tiempo de ejecución (ns))", pch=20, type="b")
406+
points(log10(C$n), log10(C$`duration(ns)`), col="green", pch=20, type = "b")
407+
points(log10(CE$n), log10(CE$`duration(ns)`), col="pink", pch=20, type = "b")
408+
points(log10(I$n), log10(I$`duration(ns)`), col="blue", pch=20, type="b")
409+
legend("topleft", col=c("red", "blue", "green", "pink"), legend=c("Selection sort", "Intro sort", "Counting sort", "Counting sort extended"), lty=1)
410+
plot(log10(S$n), log10(S$`duration(ns)`), col="red", main="Tiempo de ejecución vs. tamaño de entrada (escala logarítmica)", xlab="log(n)", ylab="log(Tiempo de ejecución (ns))", pch=20, type="b")
411+
points(log10(C$n), log10(C$`duration(ns)`), col="green", pch=20, type = "b")
412+
points(log10(CE$n), log10(CE$`duration(ns)`), col="pink", pch=20, type = "b")
413+
points(log10(I$n), log10(I$`duration(ns)`), col="blue", pch=20, type="b")
414+
legend("topleft", col=c("red", "blue", "green", "pink"), legend=c("Selection sort", "Intro sort", "Counting sort", "Counting sort extended"), lty=1)

analisis/analisis.nb.html

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

analisis/counting_sort.csv

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
n,duration(ns)
2-
10,1200
3-
100,2100
2+
10,1700
3+
100,2400
44
1000,15700
5-
10000,133800
6-
100000,1.1313e+006
5+
10000,144200
6+
100000,1.2746e+006
7+
1000000,1.22348e+007

analisis/counting_sort_extended.csv

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
n,duration(ns)
2-
10,2100
3-
100,3100
4-
1000,21800
5-
10000,193400
6-
100000,1.9442e+006
2+
10,1800
3+
100,3200
4+
1000,22900
5+
10000,242800
6+
100000,2.0631e+006
7+
1000000,1.80494e+007

analisis/intro_sort.csv

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
n,duration(ns)
22
10,1000
3-
100,8800
4-
1000,86600
5-
10000,1.3018e+006
6-
100000,2.66184e+007
3+
100,7000
4+
1000,85000
5+
10000,1.1471e+006
6+
100000,1.51627e+007
7+
1000000,1.76488e+008

analisis/selection_sort.csv

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
n,duration(ns)
2-
10,500
3-
100,13200
4-
1000,1.1077e+006
5-
10000,9.85149e+007
6-
100000,9.38982e+009
2+
10,600
3+
100,14000
4+
1000,1.0239e+006
5+
10000,1.06298e+008
6+
100000,1.0804e+010
7+
1000000,1.00128e+012

test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void test_sorting_algorithm(Function &sorting_algorithm, const std::string &file
3535
std::ofstream results("../analisis/" + filename);
3636
results << "n,duration(ns)"
3737
<< "\n";
38-
for (int i = 10; i <= pow(10, 5); i *= 10) {
38+
for (int i = 10; i <= pow(10, 6); i *= 10) {
3939
run_test(i, results, sorting_algorithm);
4040
}
4141
}

0 commit comments

Comments
 (0)