Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 1288 additions and 0 deletions
File added
taille temps mem algo typeTableau
2500 0.01 1288 insertion aleatoire
2500 0.02 1224 bulle aleatoire
2500 0.00 1288 insertion range
2500 0.00 1388 bulle range
2500 0.01 1272 insertion inverse
2500 0.01 1256 bulle inverse
2500 0.00 1304 insertion constant
2500 0.01 1304 bulle constant
2500 0.00 1268 insertion middle
2500 0.01 1344 bulle middle
5000 0.02 1272 insertion aleatoire
5000 0.05 1236 bulle aleatoire
5000 0.00 1304 insertion range
5000 0.03 1328 bulle range
5000 0.03 1236 insertion inverse
5000 0.05 1340 bulle inverse
5000 0.00 1244 insertion constant
5000 0.03 1344 bulle constant
5000 0.00 1300 insertion middle
5000 0.04 1324 bulle middle
10000 0.07 1340 insertion aleatoire
10000 0.25 1276 bulle aleatoire
10000 0.00 1392 insertion range
10000 0.13 1328 bulle range
10000 0.14 1360 insertion inverse
10000 0.21 1324 bulle inverse
10000 0.00 1396 insertion constant
10000 0.13 1312 bulle constant
10000 0.03 1312 insertion middle
10000 0.20 1308 bulle middle
20000 0.27 1244 insertion aleatoire
20000 1.13 1252 bulle aleatoire
20000 0.00 1392 insertion range
20000 0.51 1252 bulle range
20000 0.56 1244 insertion inverse
20000 0.85 1236 bulle inverse
20000 0.00 1204 insertion constant
20000 0.51 1244 bulle constant
20000 0.20 1324 insertion middle
20000 0.93 1264 bulle middle
40000 1.11 1464 insertion aleatoire
40000 4.76 1316 bulle aleatoire
40000 0.00 1432 insertion range
40000 2.04 1308 bulle range
40000 2.20 1340 insertion inverse
40000 3.42 1340 bulle inverse
40000 0.00 1312 insertion constant
40000 2.03 1380 bulle constant
40000 1.09 1320 insertion middle
40000 3.67 1396 bulle middle
80000 4.39 1604 insertion aleatoire
80000 19.49 1580 bulle aleatoire
80000 0.00 1604 insertion range
80000 8.14 1244 bulle range
80000 8.79 1664 insertion inverse
80000 13.65 1608 bulle inverse
80000 0.00 1728 insertion constant
80000 8.14 1576 bulle constant
80000 4.93 1644 insertion middle
80000 14.36 1660 bulle middle
160000 17.59 2192 insertion aleatoire
160000 78.34 2096 bulle aleatoire
160000 0.00 2348 insertion range
160000 32.59 1244 bulle range
160000 35.08 2128 insertion inverse
160000 54.67 2192 bulle inverse
160000 0.00 2140 insertion constant
160000 32.58 2080 bulle constant
160000 20.79 2128 insertion middle
160000 56.52 2128 bulle middle
2500 0.00 1288 insertion aleatoire
2500 0.01 1220 bulle aleatoire
2500 0.00 1256 insertion range
2500 0.01 1248 bulle range
2500 0.01 1228 insertion inverse
2500 0.01 1256 bulle inverse
2500 0.00 1252 insertion constant
2500 0.00 1272 bulle constant
2500 0.00 1408 insertion middle
2500 0.01 1408 bulle middle
5000 0.02 1272 insertion aleatoire
5000 0.06 1328 bulle aleatoire
5000 0.00 1344 insertion range
5000 0.03 1256 bulle range
5000 0.03 1424 insertion inverse
5000 0.05 1300 bulle inverse
5000 0.00 1320 insertion constant
5000 0.04 1280 bulle constant
5000 0.01 1236 insertion middle
5000 0.05 1364 bulle middle
10000 0.07 1344 insertion aleatoire
10000 0.25 1388 bulle aleatoire
10000 0.00 1392 insertion range
10000 0.13 1204 bulle range
10000 0.13 1328 insertion inverse
10000 0.21 1344 bulle inverse
10000 0.00 1460 insertion constant
10000 0.13 1392 bulle constant
10000 0.03 1312 insertion middle
10000 0.20 1312 bulle middle
20000 0.27 1248 insertion aleatoire
20000 1.12 1200 bulle aleatoire
20000 0.00 1276 insertion range
20000 0.51 1312 bulle range
20000 0.54 1236 insertion inverse
20000 0.86 1208 bulle inverse
20000 0.00 1308 insertion constant
20000 0.51 1316 bulle constant
20000 0.20 1316 insertion middle
20000 0.94 1244 bulle middle
40000 1.10 1356 insertion aleatoire
40000 4.74 1352 bulle aleatoire
40000 0.00 1408 insertion range
40000 2.04 1252 bulle range
40000 2.19 1312 insertion inverse
40000 3.41 1388 bulle inverse
40000 0.00 1336 insertion constant
40000 2.03 1348 bulle constant
40000 1.09 1336 insertion middle
40000 3.66 1344 bulle middle
80000 4.39 1664 insertion aleatoire
80000 19.49 1568 bulle aleatoire
80000 0.00 1576 insertion range
80000 8.15 1268 bulle range
80000 8.77 1600 insertion inverse
80000 13.66 1652 bulle inverse
80000 0.00 1616 insertion constant
80000 8.15 1600 bulle constant
80000 4.95 1604 insertion middle
80000 14.35 1636 bulle middle
160000 17.57 2180 insertion aleatoire
160000 78.40 2100 bulle aleatoire
160000 0.00 2236 insertion range
160000 32.64 1200 bulle range
160000 35.16 2144 insertion inverse
160000 54.78 2144 bulle inverse
160000 0.00 2128 insertion constant
160000 32.64 2180 bulle constant
160000 20.84 2128 insertion middle
160000 56.59 2136 bulle middle
2500 0.00 1232 insertion aleatoire
2500 0.01 1336 bulle aleatoire
2500 0.00 1336 insertion range
2500 0.00 1248 bulle range
2500 0.01 1316 insertion inverse
2500 0.01 1272 bulle inverse
2500 0.00 1284 insertion constant
2500 0.01 1264 bulle constant
2500 0.00 1288 insertion middle
2500 0.01 1272 bulle middle
5000 0.01 1424 insertion aleatoire
5000 0.06 1320 bulle aleatoire
5000 0.00 1300 insertion range
5000 0.03 1324 bulle range
5000 0.04 1272 insertion inverse
5000 0.06 1328 bulle inverse
5000 0.00 1244 insertion constant
5000 0.03 1344 bulle constant
5000 0.01 1276 insertion middle
5000 0.04 1236 bulle middle
10000 0.07 1396 insertion aleatoire
10000 0.26 1328 bulle aleatoire
10000 0.00 1284 insertion range
10000 0.13 1256 bulle range
10000 0.14 1328 insertion inverse
10000 0.21 1320 bulle inverse
10000 0.00 1340 insertion constant
10000 0.13 1316 bulle constant
10000 0.03 1320 insertion middle
10000 0.20 1360 bulle middle
20000 0.27 1248 insertion aleatoire
20000 1.12 1316 bulle aleatoire
20000 0.00 1276 insertion range
20000 0.51 1264 bulle range
20000 0.55 1256 insertion inverse
20000 0.85 1268 bulle inverse
20000 0.00 1316 insertion constant
20000 0.51 1200 bulle constant
20000 0.21 1252 insertion middle
20000 0.93 1328 bulle middle
40000 1.10 1336 insertion aleatoire
40000 4.76 1468 bulle aleatoire
40000 0.00 1376 insertion range
40000 2.05 1324 bulle range
40000 2.20 1392 insertion inverse
40000 3.42 1336 bulle inverse
40000 0.00 1396 insertion constant
40000 2.04 1336 bulle constant
40000 1.10 1336 insertion middle
40000 3.66 1336 bulle middle
80000 4.39 1664 insertion aleatoire
80000 19.56 1576 bulle aleatoire
80000 0.00 1760 insertion range
80000 8.17 1292 bulle range
80000 8.80 1600 insertion inverse
80000 13.63 1576 bulle inverse
80000 0.00 1664 insertion constant
80000 8.16 1600 bulle constant
80000 4.94 1580 insertion middle
80000 14.36 1612 bulle middle
160000 17.61 2256 insertion aleatoire
160000 78.62 2428 bulle aleatoire
160000 0.00 2296 insertion range
160000 32.63 1292 bulle range
160000 35.21 2080 insertion inverse
160000 54.71 2128 bulle inverse
160000 0.00 2128 insertion constant
160000 32.61 2140 bulle constant
160000 20.87 2080 insertion middle
160000 56.54 2432 bulle middle
2500 0.00 1336 rapide aleatoire
2500 0.03 1416 rapide range
2500 0.01 1412 rapide inverse
2500 0.02 1480 rapide constant
2500 0.00 1272 rapide middle
5000 0.00 1356 rapide aleatoire
5000 0.09 1580 rapide range
5000 0.06 1668 rapide inverse
5000 0.08 1544 rapide constant
5000 0.00 1360 rapide middle
10000 0.00 1316 rapide aleatoire
10000 0.34 1932 rapide range
10000 0.24 1932 rapide inverse
10000 0.33 1960 rapide constant
10000 0.00 1400 rapide middle
20000 0.00 1252 rapide aleatoire
20000 1.34 2480 rapide range
20000 0.94 2556 rapide inverse
20000 1.33 2492 rapide constant
20000 0.00 1244 rapide middle
40000 0.00 1336 rapide aleatoire
40000 5.35 3936 rapide range
40000 3.76 3744 rapide inverse
40000 5.35 3788 rapide constant
40000 0.01 1400 rapide middle
80000 0.01 1648 rapide aleatoire
80000 21.40 6572 rapide range
80000 15.04 6668 rapide inverse
80000 21.39 6676 rapide constant
80000 0.02 1660 rapide middle
2500 0.00 1284 rapide aleatoire
2500 0.02 1436 rapide range
2500 0.01 1440 rapide inverse
2500 0.02 1416 rapide constant
2500 0.00 1272 rapide middle
5000 0.00 1328 rapide aleatoire
5000 0.09 1636 rapide range
5000 0.06 1652 rapide inverse
5000 0.08 1588 rapide constant
5000 0.00 1320 rapide middle
10000 0.00 1280 rapide aleatoire
10000 0.34 1904 rapide range
10000 0.24 1992 rapide inverse
10000 0.34 1932 rapide constant
10000 0.00 1316 rapide middle
20000 0.00 1312 rapide aleatoire
20000 1.35 2516 rapide range
20000 0.94 2448 rapide inverse
20000 1.34 2488 rapide constant
20000 0.00 1244 rapide middle
40000 0.01 1348 rapide aleatoire
40000 5.36 3928 rapide range
40000 3.75 3752 rapide inverse
40000 5.34 3756 rapide constant
40000 0.00 1376 rapide middle
80000 0.02 1600 rapide aleatoire
80000 21.41 6584 rapide range
80000 15.05 6660 rapide inverse
80000 21.41 6624 rapide constant
80000 0.01 1580 rapide middle
2500 0.00 1264 rapide aleatoire
2500 0.02 1416 rapide range
2500 0.01 1424 rapide inverse
2500 0.02 1436 rapide constant
2500 0.00 1304 rapide middle
5000 0.00 1288 rapide aleatoire
5000 0.08 1552 rapide range
5000 0.06 1556 rapide inverse
5000 0.08 1652 rapide constant
5000 0.00 1300 rapide middle
10000 0.00 1328 rapide aleatoire
10000 0.34 1932 rapide range
10000 0.23 1932 rapide inverse
10000 0.33 1940 rapide constant
10000 0.00 1400 rapide middle
20000 0.00 1236 rapide aleatoire
20000 1.34 2556 rapide range
20000 0.94 2632 rapide inverse
20000 1.33 2488 rapide constant
20000 0.00 1248 rapide middle
40000 0.00 1336 rapide aleatoire
40000 5.35 3992 rapide range
40000 3.76 3696 rapide inverse
40000 5.36 3768 rapide constant
40000 0.01 1352 rapide middle
80000 0.01 1568 rapide aleatoire
80000 21.41 6536 rapide range
80000 15.05 6592 rapide inverse
80000 21.41 6744 rapide constant
80000 0.02 1732 rapide middle
250000 0.07 5128 fusion aleatoire
250000 0.04 5032 fusion range
250000 0.04 5120 fusion inverse
250000 0.04 5000 fusion constant
250000 0.05 5068 fusion middle
500000 0.13 8804 fusion aleatoire
500000 0.08 8804 fusion range
500000 0.08 8852 fusion inverse
500000 0.08 8840 fusion constant
500000 0.11 8840 fusion middle
1000000 0.27 16828 fusion aleatoire
1000000 0.17 16904 fusion range
1000000 0.17 16664 fusion inverse
1000000 0.17 16988 fusion constant
1000000 0.21 16916 fusion middle
2000000 0.56 32376 fusion aleatoire
2000000 0.36 32312 fusion range
2000000 0.35 32372 fusion inverse
2000000 0.35 32444 fusion constant
2000000 0.45 32384 fusion middle
4000000 1.12 63704 fusion aleatoire
4000000 0.73 63776 fusion range
4000000 0.74 63540 fusion inverse
4000000 0.76 63728 fusion constant
4000000 0.92 63700 fusion middle
8000000 2.27 126280 fusion aleatoire
8000000 1.51 125956 fusion range
8000000 1.57 126072 fusion inverse
8000000 1.56 125980 fusion constant
8000000 1.90 126264 fusion middle
16000000 4.65 251244 fusion aleatoire
16000000 3.12 251188 fusion range
16000000 3.15 251236 fusion inverse
16000000 3.14 251176 fusion constant
16000000 3.86 251220 fusion middle
250000 0.06 5040 fusion aleatoire
250000 0.03 5112 fusion range
250000 0.04 5056 fusion inverse
250000 0.04 5044 fusion constant
250000 0.05 5068 fusion middle
500000 0.13 8824 fusion aleatoire
500000 0.08 8824 fusion range
500000 0.08 8924 fusion inverse
500000 0.08 8912 fusion constant
500000 0.11 8804 fusion middle
1000000 0.27 16988 fusion aleatoire
1000000 0.17 16712 fusion range
1000000 0.17 16800 fusion inverse
1000000 0.17 16864 fusion constant
1000000 0.22 16836 fusion middle
2000000 0.54 32368 fusion aleatoire
2000000 0.35 32288 fusion range
2000000 0.36 32516 fusion inverse
2000000 0.36 32336 fusion constant
2000000 0.49 32312 fusion middle
4000000 1.13 63540 fusion aleatoire
4000000 0.73 63808 fusion range
4000000 0.73 63584 fusion inverse
4000000 0.74 63576 fusion constant
4000000 0.91 63828 fusion middle
8000000 2.27 126204 fusion aleatoire
8000000 1.50 126264 fusion range
8000000 1.54 126252 fusion inverse
8000000 1.52 126264 fusion constant
8000000 1.89 126004 fusion middle
16000000 4.66 251228 fusion aleatoire
16000000 3.16 251220 fusion range
16000000 3.20 251236 fusion inverse
16000000 3.22 251196 fusion constant
16000000 3.85 251224 fusion middle
250000 0.06 5056 fusion aleatoire
250000 0.04 5112 fusion range
250000 0.04 5024 fusion inverse
250000 0.04 5192 fusion constant
250000 0.04 5072 fusion middle
500000 0.14 8912 fusion aleatoire
500000 0.09 8880 fusion range
500000 0.08 8924 fusion inverse
500000 0.09 8876 fusion constant
500000 0.11 8868 fusion middle
1000000 0.27 16908 fusion aleatoire
1000000 0.16 16904 fusion range
1000000 0.16 16900 fusion inverse
1000000 0.17 16804 fusion constant
1000000 0.23 16924 fusion middle
2000000 0.55 32436 fusion aleatoire
2000000 0.35 32356 fusion range
2000000 0.36 32448 fusion inverse
2000000 0.37 32296 fusion constant
2000000 0.45 32440 fusion middle
4000000 1.12 63564 fusion aleatoire
4000000 0.71 63740 fusion range
4000000 0.75 63648 fusion inverse
4000000 0.73 63700 fusion constant
4000000 0.92 63612 fusion middle
8000000 2.27 126156 fusion aleatoire
8000000 1.51 126060 fusion range
8000000 1.53 126004 fusion inverse
8000000 1.52 125984 fusion constant
8000000 1.88 126004 fusion middle
16000000 4.64 251280 fusion aleatoire
16000000 3.09 251280 fusion range
16000000 3.14 251208 fusion inverse
16000000 3.24 251240 fusion constant
16000000 3.92 251356 fusion middle
renduTP2/images/tab_bulle2.png

20.6 KiB

renduTP2/images/tab_bulle2mem.png

24.6 KiB

renduTP2/images/tab_fusion2.png

22.1 KiB

renduTP2/images/tab_fusion2meme.png

15.7 KiB

renduTP2/images/tab_insert2.png

19.2 KiB

renduTP2/images/tab_insert2meme.png

23.9 KiB

renduTP2/images/tab_rapide2.png

17.6 KiB

renduTP2/images/tab_rapide2mem.png

22.6 KiB

File added
#include <stdio.h>
#include <stdlib.h>
#include "tris.h"
#include "utils.h"
int main(int argc, char *argv[])
{
if (argc != 4)
{
printf("Usage: %s [taille] [typeTableau] [typeAlgo]\n", argv[0]);
exit(1);
}
size_t taille = (size_t)atoi(argv[1]);
char typeTable = argv[2][0];
char typeAlgo = argv[3][0];
long *tab = malloc(sizeof(long) * taille);
long MAX = 10000;
genTable(tab, taille, typeTable, MAX);
switch (typeAlgo)
{
case 'i':
triInsertion(tab, taille);
break;
case 'r':
triRapide(tab, taille);
break;
case 'f':
triFusion(tab, taille);
break;
case 'b':
triABulle(tab, taille);
break;
}
free(tab);
return 0;
}
%!PS-Adobe-3.0 EPSF-3.0
%%DocumentNeededResources: font Helvetica
%%+ font Helvetica-Bold
%%+ font Helvetica-Oblique
%%+ font Helvetica-BoldOblique
%%+ font Symbol
%%Title: R Graphics Output
%%Creator: R Software
%%Pages: (atend)
%%BoundingBox: 0 0 504 504
%%EndComments
%%BeginProlog
/bp { gs sRGB gs } def
% begin .ps.prolog
/gs { gsave } bind def
/gr { grestore } bind def
/ep { showpage gr gr } bind def
/m { moveto } bind def
/l { rlineto } bind def
/np { newpath } bind def
/cp { closepath } bind def
/f { fill } bind def
/o { stroke } bind def
/c { newpath 0 360 arc } bind def
/r { 4 2 roll moveto 1 copy 3 -1 roll exch 0 exch rlineto 0 rlineto -1 mul 0 exch rlineto closepath } bind def
/p1 { stroke } bind def
/p2 { gsave bg fill grestore newpath } bind def
/p3 { gsave bg fill grestore stroke } bind def
/p6 { gsave bg eofill grestore newpath } bind def
/p7 { gsave bg eofill grestore stroke } bind def
/t { 5 -2 roll moveto gsave rotate
1 index stringwidth pop
mul neg 0 rmoveto show grestore } bind def
/ta { 4 -2 roll moveto gsave rotate show } bind def
/tb { 2 -1 roll 0 rmoveto show } bind def
/cl { grestore gsave newpath 3 index 3 index moveto 1 index
4 -1 roll lineto exch 1 index lineto lineto
closepath clip newpath } bind def
/rgb { setrgbcolor } bind def
/s { scalefont setfont } bind def
% end .ps.prolog
/sRGB { [ /CIEBasedABC
<< /DecodeLMN
[ { dup 0.03928 le
{12.92321 div}
{0.055 add 1.055 div 2.4 exp }
ifelse
} bind dup dup
]
/MatrixLMN [0.412457 0.212673 0.019334
0.357576 0.715152 0.119192
0.180437 0.072175 0.950301]
/WhitePoint [0.9505 1.0 1.0890]
>>
] setcolorspace } bind def
/srgb { setcolor } bind def
%%IncludeResource: font Helvetica
/Helvetica findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
/Encoding ISOLatin1Encoding def
currentdict
end
/Font1 exch definefont pop
%%IncludeResource: font Helvetica-Bold
/Helvetica-Bold findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
/Encoding ISOLatin1Encoding def
currentdict
end
/Font2 exch definefont pop
%%IncludeResource: font Helvetica-Oblique
/Helvetica-Oblique findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
/Encoding ISOLatin1Encoding def
currentdict
end
/Font3 exch definefont pop
%%IncludeResource: font Helvetica-BoldOblique
/Helvetica-BoldOblique findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
/Encoding ISOLatin1Encoding def
currentdict
end
/Font4 exch definefont pop
%%IncludeResource: font Symbol
/Symbol findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
currentdict
end
/Font5 exch definefont pop
%%EndProlog
%%Page: 1 1
bp
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 1 1 1 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
0.00 0.00 504.00 504.00 r p3
0.00 0.00 504.00 504.00 cl
36.20 32.79 446.35 481.07 cl
/bg { 0.9216 0.9216 0.9216 srgb } def
36.20 32.79 410.15 448.28 r p2
1 1 1 srgb
0.53 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
36.20 113.10 m
410.15 0 l
o
np
36.20 232.96 m
410.15 0 l
o
np
36.20 352.82 m
410.15 0 l
o
np
36.20 472.68 m
410.15 0 l
o
np
87.47 32.79 m
0 448.28 l
o
np
190.00 32.79 m
0 448.28 l
o
np
292.54 32.79 m
0 448.28 l
o
np
395.08 32.79 m
0 448.28 l
o
1.07 setlinewidth
[] 0 setdash
np
36.20 53.17 m
410.15 0 l
o
np
36.20 173.03 m
410.15 0 l
o
np
36.20 292.89 m
410.15 0 l
o
np
36.20 412.75 m
410.15 0 l
o
np
36.20 32.79 m
0 448.28 l
o
np
138.74 32.79 m
0 448.28 l
o
np
241.27 32.79 m
0 448.28 l
o
np
343.81 32.79 m
0 448.28 l
o
0.9725 0.4627 0.4275 srgb
np
241.27 149.05 m
0 -95.88 l
0 0 l
o
0.6392 0.6471 0 srgb
np
241.27 53.17 m
0 407.52 l
0 -407.52 l
o
0 0.7490 0.4902 srgb
np
241.27 220.97 m
0 119.86 l
0 -287.66 l
o
0 0.6902 0.9647 srgb
np
241.27 149.05 m
0 -83.90 l
0 -11.98 l
o
0.9059 0.4196 0.9529 srgb
np
241.27 53.17 m
0 407.52 l
0 -407.52 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0.3020 0.3020 0.3020 srgb
31.27 49.94 (0.0) 1 0 t
31.27 169.80 (0.1) 1 0 t
31.27 289.66 (0.2) 1 0 t
31.27 409.52 (0.3) 1 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.2000 0.2000 0.2000 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
33.46 53.17 m
2.74 0 l
o
np
33.46 173.03 m
2.74 0 l
o
np
33.46 292.89 m
2.74 0 l
o
np
33.46 412.75 m
2.74 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.2000 0.2000 0.2000 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
36.20 30.05 m
0 2.74 l
o
np
138.74 30.05 m
0 2.74 l
o
np
241.27 30.05 m
0 2.74 l
o
np
343.81 30.05 m
0 2.74 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0.3020 0.3020 0.3020 srgb
36.20 21.40 (9999.950) .5 0 t
138.74 21.40 (9999.975) .5 0 t
241.27 21.40 (10000.000) .5 0 t
343.81 21.40 (10000.025) .5 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 11 s
0 0 0 srgb
185.33 8.12 (T) 0 ta
-1.320 (aille du tab) tb
-0.220 (leau tr) tb
0.165 (ier) tb gr
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 11 s
0 0 0 srgb
13.38 216.89 (T) 90 ta
-1.320 (emps de calcul) tb gr
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 1 1 1 srgb } def
457.31 200.24 41.22 113.38 r p2
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 11 s
0 0 0 srgb
462.78 298.92 (algo) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 0.9490 0.9490 0.9490 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
462.78 274.84 17.28 17.28 r p3
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.9725 0.4627 0.4275 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
464.51 283.48 m
13.83 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 0.9490 0.9490 0.9490 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
462.78 257.56 17.28 17.28 r p3
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.6392 0.6471 0 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
464.51 266.20 m
13.83 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 0.9490 0.9490 0.9490 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
462.78 240.28 17.28 17.28 r p3
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0 0.7490 0.4902 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
464.51 248.92 m
13.83 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 0.9490 0.9490 0.9490 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
462.78 223.00 17.28 17.28 r p3
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0 0.6902 0.9647 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
464.51 231.64 m
13.83 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/bg { 0.9490 0.9490 0.9490 srgb } def
1 1 1 srgb
1.07 setlinewidth
[] 0 setdash
1 setlinecap
1 setlinejoin
10.00 setmiterlimit
462.78 205.72 17.28 17.28 r p3
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.9059 0.4196 0.9529 srgb
1.07 setlinewidth
[] 0 setdash
0 setlinecap
1 setlinejoin
10.00 setmiterlimit
np
464.51 214.36 m
13.83 0 l
o
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0 0 0 srgb
485.54 280.25 (a) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0 0 0 srgb
485.54 262.97 (c) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0 0 0 srgb
485.54 245.69 (i) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0 0 0 srgb
485.54 228.41 (m) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 9 s
0 0 0 srgb
485.54 211.13 (t) 0 0 t
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
/Font1 findfont 13 s
0 0 0 srgb
36.20 489.19 (Compar) 0 ta
-0.130 (aison tr) tb
0.195 (i) tb gr
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
0.00 0.00 504.00 504.00 cl
ep
%%Trailer
%%Pages: 1
%%EOF
#!/bin/sh
echo "taille\ttemps\tmem\talgo\ttypeTableau" > data
for i in 1 2 3 4 5
do
for taille in 2500 5000 10000 20000 40000 80000 160000
do
for typeTableau in 'aleatoire' 'range' 'inverse' 'constant' 'middle'
do
for algo in 'insertion' 'bulle'
do
res=`(/usr/bin/time -f "%U\t%M" ./sort $taille $typeTableau $algo > /dev/null ) 2>&1`
echo "$taille\t$res\t$algo\t$typeTableau" >> data
done
done
done
done
for i in 1 2 3 4 5
do
for taille in 2500 5000 10000 20000 40000 80000
do
for typeTableau in 'aleatoire' 'range' 'inverse' 'constant' 'middle'
do
for algo in 'rapide'
do
res=`(/usr/bin/time -f "%U\t%M" ./sort $taille $typeTableau $algo > /dev/null ) 2>&1`
echo "$taille\t$res\t$algo\t$typeTableau" >> data
done
done
done
done
for i in 1 2 3 4 5
do
for taille in 250000 500000 1000000 2000000 4000000 8000000 16000000
do
for typeTableau in 'aleatoire' 'range' 'inverse' 'constant' 'middle'
do
for algo in 'fusion'
do
res=`(/usr/bin/time -f "%U\t%M" ./sort $taille $typeTableau $algo > /dev/null ) 2>&1`
echo "$taille\t$res\t$algo\t$typeTableau" >> data
done
done
done
done
\ No newline at end of file
library(ggplot2)
df <- read.table("data", sep="\t", header=TRUE) #lecture d'un csv avec tabulation en séprateur
y_axis <- "Temps de calcul"
x_axis <- "Taille du tableau à trier"
p <- ggplot(data=df,
aes(x=taille, #nom des issues des colonnes de data
y=temps,
colour=factor(algo)))+geom_line()
# p <- p + geom_smooth()
p <- p + labs( x=x_axis,
y=y_axis,
color="algo",
title="Comparaison tri")
# pour sauvegarder une image (différents formats ici)
png("myplot.png")
dev.off()
print(p)
library(ggplot2)
library(plyr)
df <- read.table("data", sep="\t", header=TRUE)
fusion <- subset(df, algo == "f" )
insert <- subset(df, algo == "i" )
rapide <- subset(df, algo == "r" )
ggplot(fusion, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth()+ ggtitle("test tris fusion sur le temps")
ggsave("tab_fusion.png")
ggplot(insert, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth()+ ggtitle("test tris inset sur le temps")
ggsave("tab_insert.png")
ggplot(rapide, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth()+ ggtitle("test tris rapide sur le temps")
ggsave("tab_rapide.png")
library(ggplot2)
library(plyr)
library(ggthemes)
df <- read.table("data", sep="\t", header=TRUE)
fusion <- subset(df, algo == "fusion" )
insert <- subset(df, algo == "insertion" )
rapide <- subset(df, algo == "rapide" )
bulle <- subset(df, algo == "bulle" )
#mutate(typeTableau = factor(typeTableau, labels=c('aléatoire', 'constant', 'trié inversé', 'trié à moitié', 'trié'))
#temps
ggplot(fusion, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test fusion : temps en fonction de taille",x="Taille",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_fusion2.png")
ggplot(insert, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test insert : temps en fonction de taille",x="Taille",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_insert2.png")
ggplot(rapide, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test rapide : temps en fonction de taille",x="Taille",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_rapide2.png")
ggplot(bulle, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test bulle : temps en fonction de taille",x="Taille",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_bulle2.png")
#memoire
ggplot(fusion, aes(x = taille, y = mem, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test fusion : mem en fonction de taille",x="Memoire",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_fusion2meme.png")
ggplot(insert, aes(x = taille, y = mem, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test insert : mem en fonction de taille",x="Memoire",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_insert2meme.png")
ggplot(rapide, aes(x = taille, y = mem, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test rapide : mem en fonction de taille",x="Memoire",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_rapide2mem.png")
ggplot(bulle, aes(x = taille, y = mem, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Bulle : mem en fonction de taille",x="Memoire",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())
ggsave("./images/tab_bulle2mem.png")
\ No newline at end of file
library(ggplot2)
library(plyr)
library(ggthemes)
df <- read.table("data", sep="\t", header=TRUE)
fusion <- subset(df, algo == "fusion" )
insert <- subset(df, algo == "insertion" )
rapide <- subset(df, algo == "rapide" )
bulle <- subset(df, algo == "bulle" )
ggplot(df, aes(x = taille, y = temps, color = typeTableau)) +
geom_smooth(size=1.5,alpha=0.8)+ geom_point()+ labs(title="Test fusion : temps en fonction de taille",x="Taille",y="Temps", color = "Type tableau")+
theme_fivethirtyeight()+theme(axis.title=element_text())+
facet_grid(Type tableau algo)
ggsave("test4.png")
Erreur : unexpected symbol in:
"theme_fivethirtyeight()+theme(axis.title=element_text())+
facet_grid(Type tableau"
Exécution arrêtée
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "tris.h"
void triABulle(long* A, size_t n){
size_t i, j, tp;
for (i=0; i < n-1; ++i){
for (j=0; j < n-i-1; j++){
if (A[j] > A[j+1]){
tp = A[j];
A[j] = A[j+1];
A[j+1] = tp;
}
}
}
}
void triInsertion(long* A, size_t n) {
for(size_t i = 1; i <= n-1; i++){
long cle = A[i];
size_t j = i - 1;
while(j+1 >= j && A[j] > cle){
A[j+1] = A[j];
j = j-1;
}
A[j+1] = cle;
}
}
void triFusion(long* A, size_t n) {
sousTriFusion(A, 0, n);
}
void sousTriFusion(long* A, size_t first, size_t n) {
if(first+1 <n){ // p < r - 1
size_t middle = floor((first+n)/2);
sousTriFusion(A, first, middle);
sousTriFusion(A, middle, n);
fusion(A, first, middle, n);
}
}
void copySousTable(long* mainT, long* underT, size_t id, size_t n) {
for(size_t i = id; i < id+n; ++i) {
underT[i-id] = mainT[i];
}
}
void fusion(long* A, size_t first, size_t middle, size_t n) {
size_t n1 = middle - first; // Nb elem dans A[p , q] q exclu
size_t n2 = n - middle; // Nb elem dans A[q , r] r exclu
size_t indg = 0;
size_t indd = 0;
long* ag = malloc(sizeof(long) * n1);
long* ad = malloc(sizeof(long) * n2);
copySousTable(A, ag, first, n1);
copySousTable(A, ad, middle, n2);
int i = first;
while(i < n) {
if(indg == n1) {
A[i] = ad[indd];
indd++;
}
else if(indd == n2) {
A[i] = ag[indg];
indg++;
}
else if(ag[indg] < ad[indd]) {
A[i] = ag[indg];
indg++;
}
else {
A[i] = ad[indd];
indd++;
}
++i;
}
free(ag);
free(ad);
}
void triRapide(long* A, size_t n) {
sousTriRapide(A,0,n);
}
// Ne marche pas pas avec trié et inversé
// test < 160k
void sousTriRapide(long* A, size_t first, size_t n){
if(first+1 < n){
size_t middle = partition(A,first,n);
sousTriRapide(A,first,middle);
sousTriRapide(A,middle+1,n);
}
}
size_t partition(long* A, size_t first, size_t n) {
long pivot = A[n-1];
size_t i = first;
for(int j = first; j+2 <= n; j++){
if(A[j] <= pivot){
permuter(A,i,j);
i++;
}
}
permuter(A,i,n-1);
return i;
}
void permuter(long* A,size_t i,size_t j) {
long inter = A[i];
A[i] = A[j];
A[j] = inter;
}