From cb716d775c53286f16db1076364159142ec25dd0 Mon Sep 17 00:00:00 2001 From: Vincent Benoist Date: Tue, 22 May 2018 15:48:39 +0200 Subject: [PATCH] SD jusqua hachage --- SD/TP3_Karatsuba/.Karatsuba.c.kate-swp | Bin 0 -> 163 bytes SD/TP3_Karatsuba/Elementaire.stats | 600 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP3_Karatsuba/Karatsuba.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP3_Karatsuba/Karatsuba.stats | 600 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP3_Karatsuba/a.out | Bin 0 -> 13480 bytes SD/TP5_ABR/ABR.dot | 8 ++++++++ SD/TP5_ABR/ABR.pdf | Bin 0 -> 7646 bytes SD/TP5_ABR/Makefile | 17 +++++++++++++++++ SD/TP5_ABR/a.out | Bin 0 -> 13440 bytes SD/TP5_ABR/abr.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP5_ABR/abr.h | 23 +++++++++++++++++++++++ SD/TP5_ABR/abr.o | Bin 0 -> 5272 bytes SD/TP5_ABR/arbres correction/abr.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP5_ABR/arbres correction/abr.h | 25 +++++++++++++++++++++++++ SD/TP5_ABR/arbres correction/abr.o | Bin 0 -> 3088 bytes SD/TP5_ABR/arbres correction/main.c | 22 ++++++++++++++++++++++ SD/TP5_ABR/arbres correction/main.o | Bin 0 -> 2032 bytes SD/TP5_ABR/arbres correction/prog | Bin 0 -> 13184 bytes SD/TP5_ABR/esperanto/Makefile | 17 +++++++++++++++++ SD/TP5_ABR/esperanto/abr.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP5_ABR/esperanto/abr.h | 27 +++++++++++++++++++++++++++ SD/TP5_ABR/esperanto/main.c | 22 ++++++++++++++++++++++ SD/TP5_ABR/esperanto/values | 1 + SD/TP5_ABR/main.c | 22 ++++++++++++++++++++++ SD/TP5_ABR/main.o | Bin 0 -> 2408 bytes SD/TP5_ABR/prog | Bin 0 -> 13704 bytes SD/TP5_ABR/values | 1 + SD/TP6_Hachage/Makefile | 17 +++++++++++++++++ SD/TP6_Hachage/hachage_simple.c | 37 +++++++++++++++++++++++++++++++++++++ SD/TP6_Hachage/hachage_simple.h | 22 ++++++++++++++++++++++ SD/TP6_Hachage/hachage_simple.h.gch | Bin 0 -> 1569264 bytes SD/TP6_Hachage/hachage_simple.o | Bin 0 -> 2032 bytes SD/TP6_Hachage/liste_double.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP6_Hachage/liste_double.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP6_Hachage/liste_double.o | Bin 0 -> 4016 bytes SD/TP6_Hachage/liste_double/Makefile | 12 ++++++++++++ SD/TP6_Hachage/liste_double/liste_double.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP6_Hachage/liste_double/liste_double.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SD/TP6_Hachage/liste_double/main.c | 16 ++++++++++++++++ SD/TP6_Hachage/main.c | 24 ++++++++++++++++++++++++ SD/TP6_Hachage/main.o | Bin 0 -> 1608 bytes SD/TP6_Hachage/prog | Bin 0 -> 13784 bytes TpSD3_Karatsuba/.Karatsuba.c.kate-swp | Bin 163 -> 0 bytes TpSD3_Karatsuba/Elementaire.stats | 600 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ TpSD3_Karatsuba/Karatsuba.c | 258 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ TpSD3_Karatsuba/Karatsuba.stats | 600 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ TpSD3_Karatsuba/a.out | Bin 13480 -> 0 bytes arbres.tgz | Bin 0 -> 1037 bytes 48 files changed, 2523 insertions(+), 1458 deletions(-) create mode 100644 SD/TP3_Karatsuba/.Karatsuba.c.kate-swp create mode 100644 SD/TP3_Karatsuba/Elementaire.stats create mode 100644 SD/TP3_Karatsuba/Karatsuba.c create mode 100644 SD/TP3_Karatsuba/Karatsuba.stats create mode 100755 SD/TP3_Karatsuba/a.out create mode 100644 SD/TP5_ABR/ABR.dot create mode 100644 SD/TP5_ABR/ABR.pdf create mode 100644 SD/TP5_ABR/Makefile create mode 100755 SD/TP5_ABR/a.out create mode 100644 SD/TP5_ABR/abr.c create mode 100644 SD/TP5_ABR/abr.h create mode 100644 SD/TP5_ABR/abr.o create mode 100644 SD/TP5_ABR/arbres correction/abr.c create mode 100644 SD/TP5_ABR/arbres correction/abr.h create mode 100644 SD/TP5_ABR/arbres correction/abr.o create mode 100644 SD/TP5_ABR/arbres correction/main.c create mode 100644 SD/TP5_ABR/arbres correction/main.o create mode 100755 SD/TP5_ABR/arbres correction/prog create mode 100644 SD/TP5_ABR/esperanto/Makefile create mode 100644 SD/TP5_ABR/esperanto/abr.c create mode 100644 SD/TP5_ABR/esperanto/abr.h create mode 100644 SD/TP5_ABR/esperanto/main.c create mode 100644 SD/TP5_ABR/esperanto/values create mode 100644 SD/TP5_ABR/main.c create mode 100644 SD/TP5_ABR/main.o create mode 100755 SD/TP5_ABR/prog create mode 100644 SD/TP5_ABR/values create mode 100644 SD/TP6_Hachage/Makefile create mode 100644 SD/TP6_Hachage/hachage_simple.c create mode 100644 SD/TP6_Hachage/hachage_simple.h create mode 100644 SD/TP6_Hachage/hachage_simple.h.gch create mode 100644 SD/TP6_Hachage/hachage_simple.o create mode 100644 SD/TP6_Hachage/liste_double.c create mode 100644 SD/TP6_Hachage/liste_double.h create mode 100644 SD/TP6_Hachage/liste_double.o create mode 100644 SD/TP6_Hachage/liste_double/Makefile create mode 100644 SD/TP6_Hachage/liste_double/liste_double.c create mode 100644 SD/TP6_Hachage/liste_double/liste_double.h create mode 100644 SD/TP6_Hachage/liste_double/main.c create mode 100644 SD/TP6_Hachage/main.c create mode 100644 SD/TP6_Hachage/main.o create mode 100755 SD/TP6_Hachage/prog delete mode 100644 TpSD3_Karatsuba/.Karatsuba.c.kate-swp delete mode 100644 TpSD3_Karatsuba/Elementaire.stats delete mode 100644 TpSD3_Karatsuba/Karatsuba.c delete mode 100644 TpSD3_Karatsuba/Karatsuba.stats delete mode 100755 TpSD3_Karatsuba/a.out create mode 100644 arbres.tgz diff --git a/SD/TP3_Karatsuba/.Karatsuba.c.kate-swp b/SD/TP3_Karatsuba/.Karatsuba.c.kate-swp new file mode 100644 index 0000000..5cc6fa5 Binary files /dev/null and b/SD/TP3_Karatsuba/.Karatsuba.c.kate-swp differ diff --git a/SD/TP3_Karatsuba/Elementaire.stats b/SD/TP3_Karatsuba/Elementaire.stats new file mode 100644 index 0000000..7ff5d4c --- /dev/null +++ b/SD/TP3_Karatsuba/Elementaire.stats @@ -0,0 +1,600 @@ +# n f(n) + 1 2 + 2 11 + 3 33 + 4 46 + 5 94 + 6 120 + 7 150 + 8 167 + 9 267 + 10 319 + 11 375 + 12 405 + 13 469 + 14 503 + 15 541 + 16 562 + 17 766 + 18 870 + 19 978 + 20 1034 + 21 1150 + 22 1210 + 23 1274 + 24 1308 + 25 1440 + 26 1508 + 27 1580 + 28 1618 + 29 1698 + 30 1740 + 31 1786 + 32 1811 + 33 2223 + 34 2431 + 35 2643 + 36 2751 + 37 2971 + 38 3083 + 39 3199 + 40 3259 + 41 3495 + 42 3615 + 43 3739 + 44 3803 + 45 3935 + 46 4003 + 47 4075 + 48 4113 + 49 4381 + 50 4517 + 51 4657 + 52 4729 + 53 4877 + 54 4953 + 55 5033 + 56 5075 + 57 5239 + 58 5323 + 59 5411 + 60 5457 + 61 5553 + 62 5603 + 63 5657 + 64 5686 + 65 6514 + 66 6930 + 67 7350 + 68 7562 + 69 7990 + 70 8206 + 71 8426 + 72 8538 + 73 8982 + 74 9206 + 75 9434 + 76 9550 + 77 9786 + 78 9906 + 79 10030 + 80 10094 + 81 10570 + 82 10810 + 83 11054 + 84 11178 + 85 11430 + 86 11558 + 87 11690 + 88 11758 + 89 12026 + 90 12162 + 91 12302 + 92 12374 + 93 12522 + 94 12598 + 95 12678 + 96 12720 + 97 13260 + 98 13532 + 99 13808 + 100 13948 + 101 14232 + 102 14376 + 103 14524 + 104 14600 + 105 14900 + 106 15052 + 107 15208 + 108 15288 + 109 15452 + 110 15536 + 111 15624 + 112 15670 + 113 16002 + 114 16170 + 115 16342 + 116 16430 + 117 16610 + 118 16702 + 119 16798 + 120 16848 + 121 17044 + 122 17144 + 123 17248 + 124 17302 + 125 17414 + 126 17472 + 127 17534 + 128 17567 + 129 19227 + 130 20059 + 131 20895 + 132 21315 + 133 22159 + 134 22583 + 135 23011 + 136 23227 + 137 24087 + 138 24519 + 139 24955 + 140 25175 + 141 25619 + 142 25843 + 143 26071 + 144 26187 + 145 27079 + 146 27527 + 147 27979 + 148 28207 + 149 28667 + 150 28899 + 151 29135 + 152 29255 + 153 29731 + 154 29971 + 155 30215 + 156 30339 + 157 30591 + 158 30719 + 159 30851 + 160 30919 + 161 31875 + 162 32355 + 163 32839 + 164 33083 + 165 33575 + 166 33823 + 167 34075 + 168 34203 + 169 34711 + 170 34967 + 171 35227 + 172 35359 + 173 35627 + 174 35763 + 175 35903 + 176 35975 + 177 36515 + 178 36787 + 179 37063 + 180 37203 + 181 37487 + 182 37631 + 183 37779 + 184 37855 + 185 38155 + 186 38307 + 187 38463 + 188 38543 + 189 38707 + 190 38791 + 191 38879 + 192 38925 + 193 40009 + 194 40553 + 195 41101 + 196 41377 + 197 41933 + 198 42213 + 199 42497 + 200 42641 + 201 43213 + 202 43501 + 203 43793 + 204 43941 + 205 44241 + 206 44393 + 207 44549 + 208 44629 + 209 45233 + 210 45537 + 211 45845 + 212 46001 + 213 46317 + 214 46477 + 215 46641 + 216 46725 + 217 47057 + 218 47225 + 219 47397 + 220 47485 + 221 47665 + 222 47757 + 223 47853 + 224 47903 + 225 48571 + 226 48907 + 227 49247 + 228 49419 + 229 49767 + 230 49943 + 231 50123 + 232 50215 + 233 50579 + 234 50763 + 235 50951 + 236 51047 + 237 51243 + 238 51343 + 239 51447 + 240 51501 + 241 51897 + 242 52097 + 243 52301 + 244 52405 + 245 52617 + 246 52725 + 247 52837 + 248 52895 + 249 53123 + 250 53239 + 251 53359 + 252 53421 + 253 53549 + 254 53615 + 255 53685 + 256 53722 + 257 57046 + 258 58710 + 259 60378 + 260 61214 + 261 62890 + 262 63730 + 263 64574 + 264 64998 + 265 66690 + 266 67538 + 267 68390 + 268 68818 + 269 69678 + 270 70110 + 271 70546 + 272 70766 + 273 72490 + 274 73354 + 275 74222 + 276 74658 + 277 75534 + 278 75974 + 279 76418 + 280 76642 + 281 77534 + 282 77982 + 283 78434 + 284 78662 + 285 79122 + 286 79354 + 287 79590 + 288 79710 + 289 81498 + 290 82394 + 291 83294 + 292 83746 + 293 84654 + 294 85110 + 295 85570 + 296 85802 + 297 86726 + 298 87190 + 299 87658 + 300 87894 + 301 88370 + 302 88610 + 303 88854 + 304 88978 + 305 89934 + 306 90414 + 307 90898 + 308 91142 + 309 91634 + 310 91882 + 311 92134 + 312 92262 + 313 92770 + 314 93026 + 315 93286 + 316 93418 + 317 93686 + 318 93822 + 319 93962 + 320 94034 + 321 95950 + 322 96910 + 323 97874 + 324 98358 + 325 99330 + 326 99818 + 327 100310 + 328 100558 + 329 101546 + 330 102042 + 331 102542 + 332 102794 + 333 103302 + 334 103558 + 335 103818 + 336 103950 + 337 104970 + 338 105482 + 339 105998 + 340 106258 + 341 106782 + 342 107046 + 343 107314 + 344 107450 + 345 107990 + 346 108262 + 347 108538 + 348 108678 + 349 108962 + 350 109106 + 351 109254 + 352 109330 + 353 110414 + 354 110958 + 355 111506 + 356 111782 + 357 112338 + 358 112618 + 359 112902 + 360 113046 + 361 113618 + 362 113906 + 363 114198 + 364 114346 + 365 114646 + 366 114798 + 367 114954 + 368 115034 + 369 115638 + 370 115942 + 371 116250 + 372 116406 + 373 116722 + 374 116882 + 375 117046 + 376 117130 + 377 117462 + 378 117630 + 379 117802 + 380 117890 + 381 118070 + 382 118162 + 383 118258 + 384 118308 + 385 120480 + 386 121568 + 387 122660 + 388 123208 + 389 124308 + 390 124860 + 391 125416 + 392 125696 + 393 126812 + 394 127372 + 395 127936 + 396 128220 + 397 128792 + 398 129080 + 399 129372 + 400 129520 + 401 130668 + 402 131244 + 403 131824 + 404 132116 + 405 132704 + 406 133000 + 407 133300 + 408 133452 + 409 134056 + 410 134360 + 411 134668 + 412 134824 + 413 135140 + 414 135300 + 415 135464 + 416 135548 + 417 136760 + 418 137368 + 419 137980 + 420 138288 + 421 138908 + 422 139220 + 423 139536 + 424 139696 + 425 140332 + 426 140652 + 427 140976 + 428 141140 + 429 141472 + 430 141640 + 431 141812 + 432 141900 + 433 142568 + 434 142904 + 435 143244 + 436 143416 + 437 143764 + 438 143940 + 439 144120 + 440 144212 + 441 144576 + 442 144760 + 443 144948 + 444 145044 + 445 145240 + 446 145340 + 447 145444 + 448 145498 + 449 146838 + 450 147510 + 451 148186 + 452 148526 + 453 149210 + 454 149554 + 455 149902 + 456 150078 + 457 150778 + 458 151130 + 459 151486 + 460 151666 + 461 152030 + 462 152214 + 463 152402 + 464 152498 + 465 153230 + 466 153598 + 467 153970 + 468 154158 + 469 154538 + 470 154730 + 471 154926 + 472 155026 + 473 155422 + 474 155622 + 475 155826 + 476 155930 + 477 156142 + 478 156250 + 479 156362 + 480 156420 + 481 157216 + 482 157616 + 483 158020 + 484 158224 + 485 158636 + 486 158844 + 487 159056 + 488 159164 + 489 159592 + 490 159808 + 491 160028 + 492 160140 + 493 160368 + 494 160484 + 495 160604 + 496 160666 + 497 161126 + 498 161358 + 499 161594 + 500 161714 + 501 161958 + 502 162082 + 503 162210 + 504 162276 + 505 162536 + 506 162668 + 507 162804 + 508 162874 + 509 163018 + 510 163092 + 511 163170 + 512 163211 + 513 169863 + 514 173191 + 515 176523 + 516 178191 + 517 181531 + 518 183203 + 519 184879 + 520 185719 + 521 189075 + 522 190755 + 523 192439 + 524 193283 + 525 194975 + 526 195823 + 527 196675 + 528 197103 + 529 200491 + 530 202187 + 531 203887 + 532 204739 + 533 206447 + 534 207303 + 535 208163 + 536 208595 + 537 210319 + 538 211183 + 539 212051 + 540 212487 + 541 213363 + 542 213803 + 543 214247 + 544 214471 + 545 217923 + 546 219651 + 547 221383 + 548 222251 + 549 223991 + 550 224863 + 551 225739 + 552 226179 + 553 227935 + 554 228815 + 555 229699 + 556 230143 + 557 231035 + 558 231483 + 559 231935 + 560 232163 + 561 233951 + 562 234847 + 563 235747 + 564 236199 + 565 237107 + 566 237563 + 567 238023 + 568 238255 + 569 239179 + 570 239643 + 571 240111 + 572 240347 + 573 240823 + 574 241063 + 575 241307 + 576 241431 + 577 245011 + 578 246803 + 579 248599 + 580 249499 + 581 251303 + 582 252207 + 583 253115 + 584 253571 + 585 255391 + 586 256303 + 587 257219 + 588 257679 + 589 258603 + 590 259067 + 591 259535 + 592 259771 + 593 261623 + 594 262551 + 595 263483 + 596 263951 + 597 264891 + 598 265363 + 599 265839 diff --git a/SD/TP3_Karatsuba/Karatsuba.c b/SD/TP3_Karatsuba/Karatsuba.c new file mode 100644 index 0000000..e858d7b --- /dev/null +++ b/SD/TP3_Karatsuba/Karatsuba.c @@ -0,0 +1,258 @@ +#include +#include +#include +#include +#include + +/* + * Représentation élémentaire d'un polynôme. + * On pourrait, au minimum, rajouter le degré ! + */ + +struct poly +{ double* T; /* le tableau des coefficients */ + bool dynamic; /* indique si T a été alloué dynamiquement */ + int n; /* la taille du tableau */ +}; + +/* + * Constructeur. Le tableau T est alloué dynamiquement + */ +void init_poly (struct poly* A, int n) +{ + A->T = (double*)malloc (n * sizeof (double)); + assert (A->T != (double*)0); + A->n = n; + A->dynamic = true; +} + +/* + * Autre constructeur. Le tableau T est passé en paramètre. + * Il n'est donc pas alloué dynamiquement + */ +void init2_poly (struct poly* A, double* T, int n) +{ + A->T = T; + A->n = n; + A->dynamic = false; +} + +/* + * Destructeur. + */ +void clear_poly (struct poly* A) +{ + if (A->dynamic) + free (A->T); +} + +/* + * L'impression d'un polynôme est plus technique qu'on ne le croit :-) + * On suppose que les doubles sont en fait des entiers + */ +void print_poly (struct poly* A) +{ long c; + int i; + bool b; + + b = false; + for (i = A->n - 1; i >= 0; i--) + { if (A->T[i] != 0.0) + { if (A->T[i] > 0) + { if (b) printf (" + "); + } else + { if (b) printf (" - "); else printf ("-"); + } + b = true; + if (A->T[i] > 0) c = (long)A->T[i]; else c = (long) - A->T[i]; + if (i == 0) + printf ("%ld", c); + else if (i == 1) + { if (c != 1) printf ("%ld*x", c); else printf ("x"); + } else + { if (c != 1) printf ("%ld*x^%d", c, i); else printf ("x^%d", i); + } + } + } + printf ("\n"); +} + +/* + * R = A + B + */ +int add_poly (struct poly* R, struct poly* A, struct poly* B) +{ + int nbOpe=0; + int i; + i = 0; + while (i < A->n && i < B->n) + { R->T[i] = A->T[i] + B->T[i]; + i += 1; + nbOpe+=1; + } + while (i < A->n) + { R->T[i] = A->T[i]; + i += 1; + } + while (i < B->n) + { R->T[i] = B->T[i]; + i += 1; + } + while (i < R->n) + { R->T[i] = 0.0; + i += 1; + } + return nbOpe; +} + +/* + * R = A - B + */ +int sub_poly (struct poly* R, struct poly* A, struct poly* B) +{ + int nbOpe=0; + int i; + i = 0; + while (i < A->n && i < B->n) + { R->T[i] = A->T[i] - B->T[i]; + i += 1; + nbOpe+=1; + } + while (i < A->n) + { R->T[i] = A->T[i]; + i += 1; + } + while (i < B->n) + { R->T[i] = - B->T[i]; + i += 1; + } + while (i < R->n) + { R->T[i] = 0.0; + i += 1; + } + return nbOpe; +} + +/* + * R = A * B par la méthode élémentaire + */ +int mul_poly (struct poly* R, struct poly* A, struct poly* B) +{ + int nbOpe=0; + int a, b; + for (a = 0; a < R->n; a++) + R->T[a] = 0.0; + for (a = 0; a < A->n; a++){ + for (b = 0; b < B->n; b++){ + R->T[a+b] = R->T[a+b] + A->T[a] * B->T[b]; + nbOpe+=2; + } + } + return nbOpe; +} + +/* + * R = A * B par la méthode de Karatsuba + */ +int Karatsuba (struct poly* R, struct poly* A, struct poly* B) +{ struct poly R0, R1, R2, A0, A1, B0, B1, tmpA, tmpB; + int i, p, q; + int nbOpe =0; + +/* + * L'algorithme élémentaire est utilisé pour les cas de base + */ + if (A->n == 1 || B->n == 1) + nbOpe+=mul_poly (R, A, B); + else + { + if (A->n < B->n) + p = A->n/2; + else + p = B->n/2; +/* + * Découper les polynômes A et B en deux se fait en temps constant + */ + init2_poly (&A0, A->T, p); + init2_poly (&A1, A->T + p, A->n - p); + init2_poly (&B0, B->T, p); + init2_poly (&B1, B->T + p, B->n - p); +/* + * Les polynômes R0 et R2 sont des sous-tableaux de R. + * On évite ainsi deux recopies de tableaux. + */ + init2_poly (&R0, R->T, 2*p-1); + init2_poly (&R2, R->T + 2*p, A->n + B->n - 1 - 2*p); + nbOpe+=Karatsuba (&R0, &A0, &B0); + nbOpe+=Karatsuba (&R2, &A1, &B1); +/* + * À ce stade, R = R0 + x^(2*p)*R2. On calcule maintenant R1. + */ + if (A0.n > A1.n) q = A0.n; else q = A1.n; + init_poly (&tmpA, q); + nbOpe+= add_poly (&tmpA, &A0, &A1); + if (B0.n > B1.n) q = B0.n; else q = B1.n; + init_poly (&tmpB, q); + nbOpe+=add_poly (&tmpB, &B0, &B1); + q = tmpA.n + tmpB.n - 1; + if (q < R0.n) q = R0.n; + if (q < R2.n) q = R2.n; + init_poly (&R1, q); + nbOpe+= Karatsuba (&R1, &tmpA, &tmpB); + nbOpe+= sub_poly (&R1, &R1, &R0); + nbOpe+= sub_poly (&R1, &R1, &R2); +/* + * R = R + x^p*R1 + */ + R->T[2*p-1] = 0; + for (i = 0; i < R1.n; i++){ + R->T[p+i] = R->T[p+i] + R1.T[i]; + nbOpe++; + } + + clear_poly (&A0); + clear_poly (&A1); + clear_poly (&B0); + clear_poly (&B1); + clear_poly (&R0); + clear_poly (&R1); + clear_poly (&R2); + clear_poly (&tmpA); + clear_poly (&tmpB); + } + return nbOpe; +} + +int main () +{ struct poly A, B, R; + int i, n, N; + int nbOpe =0; + int nbNumPoly=0; + srand48 ((long)421); + + N = 600; /* taille des polynômes */ + init_poly (&A, N); + init_poly (&B, N); + init_poly (&R, 2*N-1); + for (i = 0; i < N; i++) + { + A.T [i] = floor (10.0 * drand48 () - 5.0); + B.T [i] = floor (10.0 * drand48 () - 5.0); + } + printf("#\tn\tf(n)\n"); + for (n = 1; n < N; n++) + { + nbOpe=0; + nbNumPoly=0; + A.n = n; + B.n = n; + nbNumPoly=mul_poly (&R, &A, &B); + //print_poly (&R); + nbOpe=Karatsuba (&R, &A, &B); + //print_poly (&R); + // printf("\t%d\t%d",n, nbNumPoly); + printf("\t%d\t%d\n",n, nbOpe); + + } + +} diff --git a/SD/TP3_Karatsuba/Karatsuba.stats b/SD/TP3_Karatsuba/Karatsuba.stats new file mode 100644 index 0000000..7ff5d4c --- /dev/null +++ b/SD/TP3_Karatsuba/Karatsuba.stats @@ -0,0 +1,600 @@ +# n f(n) + 1 2 + 2 11 + 3 33 + 4 46 + 5 94 + 6 120 + 7 150 + 8 167 + 9 267 + 10 319 + 11 375 + 12 405 + 13 469 + 14 503 + 15 541 + 16 562 + 17 766 + 18 870 + 19 978 + 20 1034 + 21 1150 + 22 1210 + 23 1274 + 24 1308 + 25 1440 + 26 1508 + 27 1580 + 28 1618 + 29 1698 + 30 1740 + 31 1786 + 32 1811 + 33 2223 + 34 2431 + 35 2643 + 36 2751 + 37 2971 + 38 3083 + 39 3199 + 40 3259 + 41 3495 + 42 3615 + 43 3739 + 44 3803 + 45 3935 + 46 4003 + 47 4075 + 48 4113 + 49 4381 + 50 4517 + 51 4657 + 52 4729 + 53 4877 + 54 4953 + 55 5033 + 56 5075 + 57 5239 + 58 5323 + 59 5411 + 60 5457 + 61 5553 + 62 5603 + 63 5657 + 64 5686 + 65 6514 + 66 6930 + 67 7350 + 68 7562 + 69 7990 + 70 8206 + 71 8426 + 72 8538 + 73 8982 + 74 9206 + 75 9434 + 76 9550 + 77 9786 + 78 9906 + 79 10030 + 80 10094 + 81 10570 + 82 10810 + 83 11054 + 84 11178 + 85 11430 + 86 11558 + 87 11690 + 88 11758 + 89 12026 + 90 12162 + 91 12302 + 92 12374 + 93 12522 + 94 12598 + 95 12678 + 96 12720 + 97 13260 + 98 13532 + 99 13808 + 100 13948 + 101 14232 + 102 14376 + 103 14524 + 104 14600 + 105 14900 + 106 15052 + 107 15208 + 108 15288 + 109 15452 + 110 15536 + 111 15624 + 112 15670 + 113 16002 + 114 16170 + 115 16342 + 116 16430 + 117 16610 + 118 16702 + 119 16798 + 120 16848 + 121 17044 + 122 17144 + 123 17248 + 124 17302 + 125 17414 + 126 17472 + 127 17534 + 128 17567 + 129 19227 + 130 20059 + 131 20895 + 132 21315 + 133 22159 + 134 22583 + 135 23011 + 136 23227 + 137 24087 + 138 24519 + 139 24955 + 140 25175 + 141 25619 + 142 25843 + 143 26071 + 144 26187 + 145 27079 + 146 27527 + 147 27979 + 148 28207 + 149 28667 + 150 28899 + 151 29135 + 152 29255 + 153 29731 + 154 29971 + 155 30215 + 156 30339 + 157 30591 + 158 30719 + 159 30851 + 160 30919 + 161 31875 + 162 32355 + 163 32839 + 164 33083 + 165 33575 + 166 33823 + 167 34075 + 168 34203 + 169 34711 + 170 34967 + 171 35227 + 172 35359 + 173 35627 + 174 35763 + 175 35903 + 176 35975 + 177 36515 + 178 36787 + 179 37063 + 180 37203 + 181 37487 + 182 37631 + 183 37779 + 184 37855 + 185 38155 + 186 38307 + 187 38463 + 188 38543 + 189 38707 + 190 38791 + 191 38879 + 192 38925 + 193 40009 + 194 40553 + 195 41101 + 196 41377 + 197 41933 + 198 42213 + 199 42497 + 200 42641 + 201 43213 + 202 43501 + 203 43793 + 204 43941 + 205 44241 + 206 44393 + 207 44549 + 208 44629 + 209 45233 + 210 45537 + 211 45845 + 212 46001 + 213 46317 + 214 46477 + 215 46641 + 216 46725 + 217 47057 + 218 47225 + 219 47397 + 220 47485 + 221 47665 + 222 47757 + 223 47853 + 224 47903 + 225 48571 + 226 48907 + 227 49247 + 228 49419 + 229 49767 + 230 49943 + 231 50123 + 232 50215 + 233 50579 + 234 50763 + 235 50951 + 236 51047 + 237 51243 + 238 51343 + 239 51447 + 240 51501 + 241 51897 + 242 52097 + 243 52301 + 244 52405 + 245 52617 + 246 52725 + 247 52837 + 248 52895 + 249 53123 + 250 53239 + 251 53359 + 252 53421 + 253 53549 + 254 53615 + 255 53685 + 256 53722 + 257 57046 + 258 58710 + 259 60378 + 260 61214 + 261 62890 + 262 63730 + 263 64574 + 264 64998 + 265 66690 + 266 67538 + 267 68390 + 268 68818 + 269 69678 + 270 70110 + 271 70546 + 272 70766 + 273 72490 + 274 73354 + 275 74222 + 276 74658 + 277 75534 + 278 75974 + 279 76418 + 280 76642 + 281 77534 + 282 77982 + 283 78434 + 284 78662 + 285 79122 + 286 79354 + 287 79590 + 288 79710 + 289 81498 + 290 82394 + 291 83294 + 292 83746 + 293 84654 + 294 85110 + 295 85570 + 296 85802 + 297 86726 + 298 87190 + 299 87658 + 300 87894 + 301 88370 + 302 88610 + 303 88854 + 304 88978 + 305 89934 + 306 90414 + 307 90898 + 308 91142 + 309 91634 + 310 91882 + 311 92134 + 312 92262 + 313 92770 + 314 93026 + 315 93286 + 316 93418 + 317 93686 + 318 93822 + 319 93962 + 320 94034 + 321 95950 + 322 96910 + 323 97874 + 324 98358 + 325 99330 + 326 99818 + 327 100310 + 328 100558 + 329 101546 + 330 102042 + 331 102542 + 332 102794 + 333 103302 + 334 103558 + 335 103818 + 336 103950 + 337 104970 + 338 105482 + 339 105998 + 340 106258 + 341 106782 + 342 107046 + 343 107314 + 344 107450 + 345 107990 + 346 108262 + 347 108538 + 348 108678 + 349 108962 + 350 109106 + 351 109254 + 352 109330 + 353 110414 + 354 110958 + 355 111506 + 356 111782 + 357 112338 + 358 112618 + 359 112902 + 360 113046 + 361 113618 + 362 113906 + 363 114198 + 364 114346 + 365 114646 + 366 114798 + 367 114954 + 368 115034 + 369 115638 + 370 115942 + 371 116250 + 372 116406 + 373 116722 + 374 116882 + 375 117046 + 376 117130 + 377 117462 + 378 117630 + 379 117802 + 380 117890 + 381 118070 + 382 118162 + 383 118258 + 384 118308 + 385 120480 + 386 121568 + 387 122660 + 388 123208 + 389 124308 + 390 124860 + 391 125416 + 392 125696 + 393 126812 + 394 127372 + 395 127936 + 396 128220 + 397 128792 + 398 129080 + 399 129372 + 400 129520 + 401 130668 + 402 131244 + 403 131824 + 404 132116 + 405 132704 + 406 133000 + 407 133300 + 408 133452 + 409 134056 + 410 134360 + 411 134668 + 412 134824 + 413 135140 + 414 135300 + 415 135464 + 416 135548 + 417 136760 + 418 137368 + 419 137980 + 420 138288 + 421 138908 + 422 139220 + 423 139536 + 424 139696 + 425 140332 + 426 140652 + 427 140976 + 428 141140 + 429 141472 + 430 141640 + 431 141812 + 432 141900 + 433 142568 + 434 142904 + 435 143244 + 436 143416 + 437 143764 + 438 143940 + 439 144120 + 440 144212 + 441 144576 + 442 144760 + 443 144948 + 444 145044 + 445 145240 + 446 145340 + 447 145444 + 448 145498 + 449 146838 + 450 147510 + 451 148186 + 452 148526 + 453 149210 + 454 149554 + 455 149902 + 456 150078 + 457 150778 + 458 151130 + 459 151486 + 460 151666 + 461 152030 + 462 152214 + 463 152402 + 464 152498 + 465 153230 + 466 153598 + 467 153970 + 468 154158 + 469 154538 + 470 154730 + 471 154926 + 472 155026 + 473 155422 + 474 155622 + 475 155826 + 476 155930 + 477 156142 + 478 156250 + 479 156362 + 480 156420 + 481 157216 + 482 157616 + 483 158020 + 484 158224 + 485 158636 + 486 158844 + 487 159056 + 488 159164 + 489 159592 + 490 159808 + 491 160028 + 492 160140 + 493 160368 + 494 160484 + 495 160604 + 496 160666 + 497 161126 + 498 161358 + 499 161594 + 500 161714 + 501 161958 + 502 162082 + 503 162210 + 504 162276 + 505 162536 + 506 162668 + 507 162804 + 508 162874 + 509 163018 + 510 163092 + 511 163170 + 512 163211 + 513 169863 + 514 173191 + 515 176523 + 516 178191 + 517 181531 + 518 183203 + 519 184879 + 520 185719 + 521 189075 + 522 190755 + 523 192439 + 524 193283 + 525 194975 + 526 195823 + 527 196675 + 528 197103 + 529 200491 + 530 202187 + 531 203887 + 532 204739 + 533 206447 + 534 207303 + 535 208163 + 536 208595 + 537 210319 + 538 211183 + 539 212051 + 540 212487 + 541 213363 + 542 213803 + 543 214247 + 544 214471 + 545 217923 + 546 219651 + 547 221383 + 548 222251 + 549 223991 + 550 224863 + 551 225739 + 552 226179 + 553 227935 + 554 228815 + 555 229699 + 556 230143 + 557 231035 + 558 231483 + 559 231935 + 560 232163 + 561 233951 + 562 234847 + 563 235747 + 564 236199 + 565 237107 + 566 237563 + 567 238023 + 568 238255 + 569 239179 + 570 239643 + 571 240111 + 572 240347 + 573 240823 + 574 241063 + 575 241307 + 576 241431 + 577 245011 + 578 246803 + 579 248599 + 580 249499 + 581 251303 + 582 252207 + 583 253115 + 584 253571 + 585 255391 + 586 256303 + 587 257219 + 588 257679 + 589 258603 + 590 259067 + 591 259535 + 592 259771 + 593 261623 + 594 262551 + 595 263483 + 596 263951 + 597 264891 + 598 265363 + 599 265839 diff --git a/SD/TP3_Karatsuba/a.out b/SD/TP3_Karatsuba/a.out new file mode 100755 index 0000000..2ab21d9 Binary files /dev/null and b/SD/TP3_Karatsuba/a.out differ diff --git a/SD/TP5_ABR/ABR.dot b/SD/TP5_ABR/ABR.dot new file mode 100644 index 0000000..1d40f0b --- /dev/null +++ b/SD/TP5_ABR/ABR.dot @@ -0,0 +1,8 @@ +digraph G { +14 -> 7 [label="gauche"]; +7 -> 3 [label="gauche"]; +14 -> 88 [label="droit"]; +88 -> 51 [label="gauche"]; +51 -> 17 [label="gauche"]; +51 -> 53 [label="droit"]; +} diff --git a/SD/TP5_ABR/ABR.pdf b/SD/TP5_ABR/ABR.pdf new file mode 100644 index 0000000..cbf9c35 Binary files /dev/null and b/SD/TP5_ABR/ABR.pdf differ diff --git a/SD/TP5_ABR/Makefile b/SD/TP5_ABR/Makefile new file mode 100644 index 0000000..5b66486 --- /dev/null +++ b/SD/TP5_ABR/Makefile @@ -0,0 +1,17 @@ +.PHONY: clean,real-clean +LD = gcc +CC = gcc +CFLAGS = -Wall -W +SRC=$(wildcard *.c) +OBJ=$(SRC:.c=.o) +prog : $(OBJ) + $(LD) -o $@ $^ + +%.o : %.c + $(CC) $(CFLAGS) -c $^ + +clean : + rm -f *.o + +real-clean : clean + rm -f prog diff --git a/SD/TP5_ABR/a.out b/SD/TP5_ABR/a.out new file mode 100755 index 0000000..4a83853 Binary files /dev/null and b/SD/TP5_ABR/a.out differ diff --git a/SD/TP5_ABR/abr.c b/SD/TP5_ABR/abr.c new file mode 100644 index 0000000..8d059c0 --- /dev/null +++ b/SD/TP5_ABR/abr.c @@ -0,0 +1,143 @@ +#include +#include +#include +#include "abr.h" + + +/* + struct abr { + struct abr* gauche; + int valeur; + struct abr* droit; +}; +*/ +static struct abr* new_feuille (int x){ + + struct abr* F; + + F = (struct abr*)malloc (sizeof (struct abr)); + F->gauche = NIL; + F->valeur = x; + F->droit = NIL; + return F; +} + + +struct abr* ajout_abr_rec (int x, struct abr* A){ + if (A == NIL) + return new_feuille (x); + else if (x < A->valeur) + A->gauche = ajout_abr_rec (x, A->gauche); + else + A->droit = ajout_abr_rec (x, A->droit); + return A; +} + +int max( int a, int b){ + + if(a>b){ + return a; + } + return b; +} + +int hauteur_abr( struct abr* A){ + + if(A == NIL){ + return -1; + } + return max(hauteur_abr(A->gauche),hauteur_abr(A->droit))+1; + +} + + +bool recherche_abr_rec (int x, struct abr* A){ + bool b = false; + if (A == NIL){ + return b; + } else if ( x == A->valeur ){ + return true; + } else if (x < A->valeur){ + b=recherche_abr_rec (x, A->gauche); + } else{ + b=recherche_abr_rec (x, A->droit); + } + return b; +} + + +static void affiche_abr (struct abr* A){ + if( A!= NIL){ + affiche_abr(A->gauche); + printf("- %d ", A-> valeur); + affiche_abr(A->droit); + } + +} + + +void imprime_abr (struct abr* A){ + printf("Valeurs de l'arbre: \n"); + affiche_abr(A); + printf(" -\n"); +} + + +static void affiche_abrV2 (struct abr* A, int profondeur){ + if( A!= NIL){ + int i = 0; + for(i=0; i<=profondeur; i++){ + printf("\t"); + } + + printf("%d\n ", A-> valeur); + affiche_abrV2(A->droit, profondeur+1); + affiche_abrV2(A->gauche, profondeur+1); + } + +} + +void imprime_abrV2 (struct abr* A){ + printf("Valeurs de l'arbre: \n"); + affiche_abrV2(A, 0); + printf("\n"); +} + +void clear_abr (struct abr* A) +{ + if (A != NIL) + { clear_abr (A->gauche); + clear_abr (A->droit); + free (A); + } +} + +void imprimeArbreDot( struct abr* A, FILE* f){ + if(A->gauche != NIL){ + fprintf(f,"%d -> %d [label=\"gauche\"];\n", A->valeur, A->gauche->valeur); + imprimeArbreDot(A->gauche,f); + } + if(A->droit != NIL){ + fprintf(f,"%d -> %d [label=\"droit\"];\n", A->valeur, A->droit->valeur); + imprimeArbreDot(A->droit,f); + } +} + + +void imprimeDot( struct abr* A){ + FILE* f; + f = fopen("ABR.dot", "w"); + fprintf(f,"digraph G {\n"); + if(A==NIL){ + fprintf(f,"NIL\n"); + }else if (A->gauche == NIL && A->droit == NIL){ + fprintf(f,"%d\n", A->valeur); + }else { + imprimeArbreDot(A,f); + } + fprintf(f,"}\n"); + fclose(f); + system("dot -Tpdf ABR.dot -GRANKDIR=LR -o ABR.pdf"); + system("evince ABR.pdf &"); +} + diff --git a/SD/TP5_ABR/abr.h b/SD/TP5_ABR/abr.h new file mode 100644 index 0000000..497816b --- /dev/null +++ b/SD/TP5_ABR/abr.h @@ -0,0 +1,23 @@ +#include + +struct abr { + struct abr* gauche; + int valeur; + struct abr* droit; +}; + +#define NIL (struct abr*)0 + + +extern struct abr* ajout_abr_rec (int, struct abr*); + +/* Calcule la hauteur d'un abr*/ +extern int hauteur_abr( struct abr*); + +extern bool recherche_abr_rec (int, struct abr*); + +extern void imprime_abr (struct abr*); + +extern void imprime_abrV2 (struct abr*); + +extern void clear_abr (struct abr*); diff --git a/SD/TP5_ABR/abr.o b/SD/TP5_ABR/abr.o new file mode 100644 index 0000000..92e9ecd Binary files /dev/null and b/SD/TP5_ABR/abr.o differ diff --git a/SD/TP5_ABR/arbres correction/abr.c b/SD/TP5_ABR/arbres correction/abr.c new file mode 100644 index 0000000..762d425 --- /dev/null +++ b/SD/TP5_ABR/arbres correction/abr.c @@ -0,0 +1,96 @@ +#include +#include +#include +#include "abr.h" + +bool recherche_abr_iter (int x, struct abr* A0) +{ struct abr* A; // curseur pour se déplacer dans A0 + bool trouve; + + A = A0; + trouve = false; + while (A != NIL && !trouve) + { + if (A->valeur == x) + trouve = true; + else if (A->valeur < x) + A = A->droit; + else + A = A->gauche; + } + return trouve; +} + +bool recherche_abr_rec (int x, struct abr* A) +{ + if (A == NIL) + return false; + else if (A->valeur == x) + return true; + else if (A->valeur < x) + return recherche_abr_rec (x, A->droit); + else + return recherche_abr_rec (x, A->gauche); +} + +static struct abr* new_feuille (int x) +{ struct abr* F; + + F = (struct abr*)malloc (sizeof (struct abr)); + F->gauche = NIL; + F->valeur = x; + F->droit = NIL; + return F; +} + +struct abr* ajout_abr_iter (int x, struct abr* A0) +{ + if (A0 == NIL) + return new_feuille (x); + else + { struct abr* prec = NIL; + struct abr* cour = A0; + while (cour != NIL) + { prec = cour; + if (cour->valeur < x) + cour = cour->droit; + else + cour = cour->gauche; + } + if (prec->valeur < x) + prec->droit = new_feuille (x); + else + prec->gauche = new_feuille (x); + return A0; + } +} + +struct abr* ajout_abr_rec (int x, struct abr* A) +{ + if (A == NIL) + return new_feuille (x); + else if (x < A->valeur) + A->gauche = ajout_abr_rec (x, A->gauche); + else + A->droit = ajout_abr_rec (x, A->droit); + return A; +} + +void clear_abr (struct abr* A) +{ + if (A != NIL) + { clear_abr (A->gauche); + clear_abr (A->droit); + free (A); + } +} + +void imprime_abr (struct abr* A) +{ + if (A != NIL) + { imprime_abr (A->gauche); + printf ("%d\n", A->valeur); + imprime_abr (A->droit); + } +} + diff --git a/SD/TP5_ABR/arbres correction/abr.h b/SD/TP5_ABR/arbres correction/abr.h new file mode 100644 index 0000000..d73c6d2 --- /dev/null +++ b/SD/TP5_ABR/arbres correction/abr.h @@ -0,0 +1,25 @@ +// abr.h + +#include + +struct abr { + struct abr* gauche; // ne contient que des entiers < valeur + int valeur; + struct abr* droit; // ne contient que des entiers > valeur +}; + +#define NIL (struct abr*)0 + +extern struct abr* ajout_abr_iter (int, struct abr*); + +extern struct abr* ajout_abr_rec (int, struct abr*); + +extern bool recherche_abr_iter (int, struct abr*); + +extern bool recherche_abr_rec (int, struct abr*); + +extern void imprime_abr (struct abr*); + +extern void clear_abr (struct abr*); + + diff --git a/SD/TP5_ABR/arbres correction/abr.o b/SD/TP5_ABR/arbres correction/abr.o new file mode 100644 index 0000000..e2a351b Binary files /dev/null and b/SD/TP5_ABR/arbres correction/abr.o differ diff --git a/SD/TP5_ABR/arbres correction/main.c b/SD/TP5_ABR/arbres correction/main.c new file mode 100644 index 0000000..57ef3d8 --- /dev/null +++ b/SD/TP5_ABR/arbres correction/main.c @@ -0,0 +1,22 @@ +#include +#include "abr.h" + +int main () +{ int T [] = { 17, 43, 109, 56, 8, 11 }; + int i, n = sizeof(T)/sizeof(int); + + struct abr* A; + + A = NIL; + for (i = 0; i < n; i++) + { A = ajout_abr_rec (T[i], A); + } + if (recherche_abr_rec (14, A)) + printf ("14 est présent dans A\n"); + else + printf ("14 est absent de A\n"); + imprime_abr (A); + clear_abr (A); + return 0; +} + diff --git a/SD/TP5_ABR/arbres correction/main.o b/SD/TP5_ABR/arbres correction/main.o new file mode 100644 index 0000000..da15a4f Binary files /dev/null and b/SD/TP5_ABR/arbres correction/main.o differ diff --git a/SD/TP5_ABR/arbres correction/prog b/SD/TP5_ABR/arbres correction/prog new file mode 100755 index 0000000..3abbd3d Binary files /dev/null and b/SD/TP5_ABR/arbres correction/prog differ diff --git a/SD/TP5_ABR/esperanto/Makefile b/SD/TP5_ABR/esperanto/Makefile new file mode 100644 index 0000000..5b66486 --- /dev/null +++ b/SD/TP5_ABR/esperanto/Makefile @@ -0,0 +1,17 @@ +.PHONY: clean,real-clean +LD = gcc +CC = gcc +CFLAGS = -Wall -W +SRC=$(wildcard *.c) +OBJ=$(SRC:.c=.o) +prog : $(OBJ) + $(LD) -o $@ $^ + +%.o : %.c + $(CC) $(CFLAGS) -c $^ + +clean : + rm -f *.o + +real-clean : clean + rm -f prog diff --git a/SD/TP5_ABR/esperanto/abr.c b/SD/TP5_ABR/esperanto/abr.c new file mode 100644 index 0000000..dade6a3 --- /dev/null +++ b/SD/TP5_ABR/esperanto/abr.c @@ -0,0 +1,143 @@ +#include +#include +#include +#include "abr.h" + + +/* + struct abr { + struct abr* gauche; + int valeur; + struct abr* droit; +}; +*/ +static struct abr* new_feuille (wchar_t clef, wchar_t satellite){ + + struct abr* F; + + F = (struct abr*)malloc (sizeof (struct abr)); + F->gauche = NIL; + F->clef = x; + F->droit = NIL; + return F; +} + + +struct abr* ajout_abr_rec (wchar_t clef, wchar_t satellite, struct abr* A){ + if (A == NIL) + return new_feuille (x); + else if (wcscmp(clef,A->clef)== -1)// + A->gauche = ajout_abr_rec (clef, satellite, A->gauche); + else + A->droit = ajout_abr_rec (clef, satellite, A->droit); + return A; +} + +int max( int a, int b){ + + if(a>b){ + return a; + } + return b; +} + +int hauteur_abr( struct abr* A){ + + if(A == NIL){ + return -1; + } + return max(hauteur_abr(A->gauche),hauteur_abr(A->droit))+1; + +} + + +wchar_t* recherche_abr_rec (wchar_t* x, struct abr* A){ + wchar_t* res = (wchar_t*)0; + if (A == NIL){ + return res; + } else if (wcscmp(x,A->clef)== 0 ){ + return x; + } else if (wcscmp(x,A->clef)== -1){ + wcscpy(res,recherche_abr_rec (x, A->gauche)); + } else{ + wcscpy(res,recherche_abr_rec (x, A->gauche)); + } + return res; +} + + +static void affiche_abr (struct abr* A){ + if( A!= NIL){ + affiche_abr(A->gauche); + printf("- %d ", A-> valeur); + affiche_abr(A->droit); + } + +} + + +void imprime_abr (struct abr* A){ + printf("Valeurs de l'arbre: \n"); + affiche_abr(A); + printf(" -\n"); +} + + +static void affiche_abrV2 (struct abr* A, int profondeur){ + if( A!= NIL){ + int i = 0; + for(i=0; i<=profondeur; i++){ + printf("\t"); + } + + printf("%d\n ", A-> valeur); + affiche_abrV2(A->droit, profondeur+1); + affiche_abrV2(A->gauche, profondeur+1); + } + +} + +void imprime_abrV2 (struct abr* A){ + printf("Valeurs de l'arbre: \n"); + affiche_abrV2(A, 0); + printf("\n"); +} + +void clear_abr (struct abr* A) +{ + if (A != NIL) + { clear_abr (A->gauche); + clear_abr (A->droit); + free (A); + } +} +/* +void imprimeArbreDot( struct abr* A, FILE* f){ + if(A->gauche != NIL){ + fprintf(f,"%d -> %d [label=\"gauche\"];\n", A->valeur, A->gauche->valeur); + imprimeArbreDot(A->gauche,f); + } + if(A->droit != NIL){ + fprintf(f,"%d -> %d [label=\"droit\"];\n", A->valeur, A->droit->valeur); + imprimeArbreDot(A->droit,f); + } +} + + +void imprimeDot( struct abr* A){ + FILE* f; + f = fopen("ABR.dot", "w"); + fprintf(f,"digraph G {\n"); + if(A==NIL){ + fprintf(f,"NIL\n"); + }else if (A->gauche == NIL && A->droit == NIL){ + fprintf(f,"%d\n", A->valeur); + }else { + imprimeArbreDot(A,f); + } + fprintf(f,"}\n"); + fclose(f); + system("dot -Tpdf ABR.dot -GRANKDIR=LR -o ABR.pdf"); + system("evince ABR.pdf &"); +} +*/ diff --git a/SD/TP5_ABR/esperanto/abr.h b/SD/TP5_ABR/esperanto/abr.h new file mode 100644 index 0000000..dd33db8 --- /dev/null +++ b/SD/TP5_ABR/esperanto/abr.h @@ -0,0 +1,27 @@ +#include +#include + +typedef wchar_t wstring [MAXLEN]; + +struct abr { + struct abr* gauche; + wchar_t clef; + wchar_t satellite; + struct abr* droit; +}; + +#define NIL (struct abr*)0 + + +extern struct abr* ajout_abr_rec (wchar_t, wchar_t , struct abr*); + +/* Calcule la hauteur d'un abr*/ +extern int hauteur_abr( struct abr*); + +extern bool recherche_abr_rec (int, struct abr*); + +extern void imprime_abr (struct abr*); + +extern void imprime_abrV2 (struct abr*); + +extern void clear_abr (struct abr*); diff --git a/SD/TP5_ABR/esperanto/main.c b/SD/TP5_ABR/esperanto/main.c new file mode 100644 index 0000000..e6acac9 --- /dev/null +++ b/SD/TP5_ABR/esperanto/main.c @@ -0,0 +1,22 @@ +#include +#include "abr.h" + +int main (){ + struct abr* racine; + int x; + racine = NIL; + scanf ("%d", &x); + while (x != -1) { + racine = ajout_abr_rec(x, racine); + imprime_abrV2(racine); + //imprime_abr(racine); + scanf("%d", &x); + } + printf("%s\n", recherche_abr_rec (3, racine) ? "La valeur est bien présente" : "Val introuvée"); + + printf ("la hauteur de l'ABR est %d\n", hauteur_abr(racine)); + // imprimeDot(racine); + // printf ("le nombre de noeuds de l'ABR est %d\n",nombre_noeuds_abr (racine)); + clear_abr (racine); + return 0; +} diff --git a/SD/TP5_ABR/esperanto/values b/SD/TP5_ABR/esperanto/values new file mode 100644 index 0000000..a41b17e --- /dev/null +++ b/SD/TP5_ABR/esperanto/values @@ -0,0 +1 @@ +14 7 88 51 17 53 3 -1 diff --git a/SD/TP5_ABR/main.c b/SD/TP5_ABR/main.c new file mode 100644 index 0000000..617f584 --- /dev/null +++ b/SD/TP5_ABR/main.c @@ -0,0 +1,22 @@ +#include +#include "abr.h" + +int main (){ + struct abr* racine; + int x; + racine = NIL; + scanf ("%d", &x); + while (x != -1) { + racine = ajout_abr_rec(x, racine); + imprime_abrV2(racine); + //imprime_abr(racine); + scanf("%d", &x); + } + printf("%s\n", recherche_abr_rec (3, racine) ? "La valeur est bien présente" : "Val introuvée"); + + printf ("la hauteur de l'ABR est %d\n", hauteur_abr(racine)); + imprimeDot(racine); + // printf ("le nombre de noeuds de l'ABR est %d\n",nombre_noeuds_abr (racine)); + clear_abr (racine); + return 0; +} diff --git a/SD/TP5_ABR/main.o b/SD/TP5_ABR/main.o new file mode 100644 index 0000000..86aa9db Binary files /dev/null and b/SD/TP5_ABR/main.o differ diff --git a/SD/TP5_ABR/prog b/SD/TP5_ABR/prog new file mode 100755 index 0000000..cd46925 Binary files /dev/null and b/SD/TP5_ABR/prog differ diff --git a/SD/TP5_ABR/values b/SD/TP5_ABR/values new file mode 100644 index 0000000..a41b17e --- /dev/null +++ b/SD/TP5_ABR/values @@ -0,0 +1 @@ +14 7 88 51 17 53 3 -1 diff --git a/SD/TP6_Hachage/Makefile b/SD/TP6_Hachage/Makefile new file mode 100644 index 0000000..8c97a3a --- /dev/null +++ b/SD/TP6_Hachage/Makefile @@ -0,0 +1,17 @@ +.PHONY: clean,real-clean +LD = gcc +CC = gcc +CFLAGS = +SRC=$(wildcard *.c) +OBJ=$(SRC:.c=.o) +prog : $(OBJ) + $(LD) -o $@ $^ + +%.o : %.c + $(CC) $(CFLAGS) -c $^ + +clean : + rm -f *.o + +real-clean : clean + rm -f prog diff --git a/SD/TP6_Hachage/hachage_simple.c b/SD/TP6_Hachage/hachage_simple.c new file mode 100644 index 0000000..5b2851d --- /dev/null +++ b/SD/TP6_Hachage/hachage_simple.c @@ -0,0 +1,37 @@ +#include "hachage_simple.h" +#include "liste_double.h" +#include +#include +#include +#include + + + +void init_table (struct table* T, fonction_hachage* H){ + int i = 0; + for(i=0; itab[N].L); + } +} + +void clear_table (struct table* T){ + int i = 0; + for(i=0; itab[N].L); + } + + +} + +void enregistrer_table (struct table* T, double d){ + +} + +bool rechercher_table (struct table* T, double d){ + return true; +} + +void imprimer_table (struct table* T){ + +} + diff --git a/SD/TP6_Hachage/hachage_simple.h b/SD/TP6_Hachage/hachage_simple.h new file mode 100644 index 0000000..1820e98 --- /dev/null +++ b/SD/TP6_Hachage/hachage_simple.h @@ -0,0 +1,22 @@ +/* hachage_simple.h */ +#include "liste_double.h" +#include + +struct alveole { + struct liste_double L; +}; + +typedef int fonction_hachage (double); + +#define N 10 +struct table { + struct alveole tab [N]; + fonction_hachage* hash; +}; + +extern void init_table (struct table*, fonction_hachage*); +extern void clear_table (struct table*); +extern void enregistrer_table (struct table*, double); +extern bool rechercher_table (struct table*, double); +extern void imprimer_table (struct table*); + diff --git a/SD/TP6_Hachage/hachage_simple.h.gch b/SD/TP6_Hachage/hachage_simple.h.gch new file mode 100644 index 0000000..a1e6bbc Binary files /dev/null and b/SD/TP6_Hachage/hachage_simple.h.gch differ diff --git a/SD/TP6_Hachage/hachage_simple.o b/SD/TP6_Hachage/hachage_simple.o new file mode 100644 index 0000000..68ed7f0 Binary files /dev/null and b/SD/TP6_Hachage/hachage_simple.o differ diff --git a/SD/TP6_Hachage/liste_double.c b/SD/TP6_Hachage/liste_double.c new file mode 100644 index 0000000..6a140c5 --- /dev/null +++ b/SD/TP6_Hachage/liste_double.c @@ -0,0 +1,121 @@ +#include +#include +#include +#include +#include "liste_double.h" + +void init_liste_double (struct liste_double* L) +{ + L->tete = (struct maillon_double*)0; + L->nbelem = 0; +} + +void ajouter_en_tete_liste_double (struct liste_double* L, double d) +{ struct maillon_double* nouveau; + + nouveau = (struct maillon_double*)malloc (sizeof (struct maillon_double)); + assert (nouveau != (struct maillon_double*)0); +/* appeler ici un éventuel constructeur pour nouveau->value */ + nouveau->value = d; /* affectation de la valeur */ + nouveau->next = L->tete; + L->tete = nouveau; + L->nbelem += 1; +} + +void clear_liste_double (struct liste_double* L) +{ struct maillon_double* courant; + struct maillon_double* suivant; + int i; + + courant = L->tete; + for (i = 0; i < L->nbelem; i++) + { suivant = courant->next; +/* appeler ici un éventuel destructeur pour nouveau->value */ + free (courant); + courant = suivant; + } +} + + +bool recherche_liste_double (struct liste_double* L, double d) +{ struct maillon_double* M; + int i; + + M = L->tete; + for (i = 0; i < L->nbelem; i++) + { + if (M->value == d){ + return true; + } + M = M->next; + } + return false; +} +/* + * Sous-fonction de set_liste_double. + * Si L = [m1, m2, ..., mn] avant l'appel alors + * L = [mn, ..., m2, m1] après l'appel. + * Aucune allocation dynamique n'est effectuée. + * Seuls les pointeurs sont modifiés + */ + +static void retourner_liste_double (struct liste_double* L) +{ struct maillon_double *precedent, *courant, *suivant; + int i; + + if (L->nbelem >= 2) + { courant = L->tete; + suivant = courant->next; + courant->next = (struct maillon_double*)0; + for (i = 1; i < L->nbelem; i++) + { precedent = courant; + courant = suivant; + suivant = suivant->next; + courant->next = precedent; + } + L->tete = courant; + } +} + +void set_liste_double (struct liste_double* dst, struct liste_double* src) +{ struct maillon_double* M; + int i; + + if (dst != src) + { clear_liste_double (dst); + init_liste_double (dst); + M = src->tete; + for (i = 0; i < src->nbelem; i++) + { ajouter_en_tete_liste_double (dst, M->value); + M = M->next; + } + retourner_liste_double (dst); + } +} + +void extraire_tete_liste_double (double* d, struct liste_double* L) +{ struct maillon_double* tete; + + assert (L->nbelem != 0); + tete = L->tete; + *d = tete->value; /* affectation */ + L->tete = tete->next; + L->nbelem -= 1; + free (tete); +} + +void imprimer_liste_double (struct liste_double* L) +{ struct maillon_double* M; + int i; + + printf ("["); + M = L->tete; + for (i = 0; i < L->nbelem; i++) + { if (i == 0) + printf ("%f", M->value); + else + printf (", %f", M->value); + M = M->next; + } + printf ("]\n"); +} diff --git a/SD/TP6_Hachage/liste_double.h b/SD/TP6_Hachage/liste_double.h new file mode 100644 index 0000000..469c932 --- /dev/null +++ b/SD/TP6_Hachage/liste_double.h @@ -0,0 +1,72 @@ +#if ! defined (LISTE_DOUBLE_H) +#define LISTE_DOUBLE_H 1 + +/********************************************************************** + * IMPLANTATION + * + * Spécification de l'implantation + * + * Implantation des listes simplement chaînées de doubles + * + * Les maillons sont alloués dynamiquement. + * Le champ next du dernier maillon vaut (struct maillon_double*)0 + * + * Le champ tete d'une liste pointe vers le premier maillon + * Le champ nbelem est égal au nombre de maillons de la liste + * La liste vide est codée par (tete, nbelem) = ((struct maillon_double*)0, 0) + * + * Des listes distinctes ont des maillons distincts (pas de maillon partagé). + **********************************************************************/ + +struct maillon_double +{ double value; + struct maillon_double* next; +}; + +struct liste_double +{ struct maillon_double* tete; + int nbelem; +}; + +/********************************************************************** + * PROTOTYPES DES FONCTIONS (TYPE ABSTRAIT) + **********************************************************************/ + +/* + * Constructeur. Initialise son paramètre à la liste vide + */ + +extern void init_liste_double (struct liste_double*); + +/* + * Destructeur + */ + +extern void clear_liste_double (struct liste_double*); + +/* + * Affecte une copie de src à dst + */ + +extern void set_liste_double + (struct liste_double* dst, struct liste_double* src); + +/* + * Ajout d'un double en tête de liste + */ + +extern void ajouter_en_tete_liste_double (struct liste_double*, double); + +/* + * Affecte à *d la valeur du premier élément de L et supprime cet élément de L. + * La liste L est supposée non vide. + */ + +extern void extraire_tete_liste_double (double* d, struct liste_double* L); + +/* + * Impression. + */ + +extern void imprimer_liste_double (struct liste_double*); +#endif diff --git a/SD/TP6_Hachage/liste_double.o b/SD/TP6_Hachage/liste_double.o new file mode 100644 index 0000000..1daa129 Binary files /dev/null and b/SD/TP6_Hachage/liste_double.o differ diff --git a/SD/TP6_Hachage/liste_double/Makefile b/SD/TP6_Hachage/liste_double/Makefile new file mode 100644 index 0000000..cb8c5da --- /dev/null +++ b/SD/TP6_Hachage/liste_double/Makefile @@ -0,0 +1,12 @@ +CC=gcc +CFLAGS=-g -Wall -Wmissing-prototypes +LDFLAGS=-g +objects := $(patsubst %.c,%.o,$(wildcard *.c)) +all: main +clean: + -rm $(objects) + -rm main +main: $(objects) +# gcc -MM *.c pour obtenir les deux lignes ci-dessous +liste_double.o: liste_double.c liste_double.h +main.o: main.c liste_double.h diff --git a/SD/TP6_Hachage/liste_double/liste_double.c b/SD/TP6_Hachage/liste_double/liste_double.c new file mode 100644 index 0000000..0695760 --- /dev/null +++ b/SD/TP6_Hachage/liste_double/liste_double.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include "liste_double.h" + +void init_liste_double (struct liste_double* L) +{ + L->tete = (struct maillon_double*)0; + L->nbelem = 0; +} + +void ajouter_en_tete_liste_double (struct liste_double* L, double d) +{ struct maillon_double* nouveau; + + nouveau = (struct maillon_double*)malloc (sizeof (struct maillon_double)); + assert (nouveau != (struct maillon_double*)0); +/* appeler ici un éventuel constructeur pour nouveau->value */ + nouveau->value = d; /* affectation de la valeur */ + nouveau->next = L->tete; + L->tete = nouveau; + L->nbelem += 1; +} + +void clear_liste_double (struct liste_double* L) +{ struct maillon_double* courant; + struct maillon_double* suivant; + int i; + + courant = L->tete; + for (i = 0; i < L->nbelem; i++) + { suivant = courant->next; +/* appeler ici un éventuel destructeur pour nouveau->value */ + free (courant); + courant = suivant; + } +} + +/* + * Sous-fonction de set_liste_double. + * Si L = [m1, m2, ..., mn] avant l'appel alors + * L = [mn, ..., m2, m1] après l'appel. + * Aucune allocation dynamique n'est effectuée. + * Seuls les pointeurs sont modifiés + */ + +static void retourner_liste_double (struct liste_double* L) +{ struct maillon_double *precedent, *courant, *suivant; + int i; + + if (L->nbelem >= 2) + { courant = L->tete; + suivant = courant->next; + courant->next = (struct maillon_double*)0; + for (i = 1; i < L->nbelem; i++) + { precedent = courant; + courant = suivant; + suivant = suivant->next; + courant->next = precedent; + } + L->tete = courant; + } +} + +void set_liste_double (struct liste_double* dst, struct liste_double* src) +{ struct maillon_double* M; + int i; + + if (dst != src) + { clear_liste_double (dst); + init_liste_double (dst); + M = src->tete; + for (i = 0; i < src->nbelem; i++) + { ajouter_en_tete_liste_double (dst, M->value); + M = M->next; + } + retourner_liste_double (dst); + } +} + +void extraire_tete_liste_double (double* d, struct liste_double* L) +{ struct maillon_double* tete; + + assert (L->nbelem != 0); + tete = L->tete; + *d = tete->value; /* affectation */ + L->tete = tete->next; + L->nbelem -= 1; + free (tete); +} + +void imprimer_liste_double (struct liste_double* L) +{ struct maillon_double* M; + int i; + + printf ("["); + M = L->tete; + for (i = 0; i < L->nbelem; i++) + { if (i == 0) + printf ("%f", M->value); + else + printf (", %f", M->value); + M = M->next; + } + printf ("]\n"); +} diff --git a/SD/TP6_Hachage/liste_double/liste_double.h b/SD/TP6_Hachage/liste_double/liste_double.h new file mode 100644 index 0000000..469c932 --- /dev/null +++ b/SD/TP6_Hachage/liste_double/liste_double.h @@ -0,0 +1,72 @@ +#if ! defined (LISTE_DOUBLE_H) +#define LISTE_DOUBLE_H 1 + +/********************************************************************** + * IMPLANTATION + * + * Spécification de l'implantation + * + * Implantation des listes simplement chaînées de doubles + * + * Les maillons sont alloués dynamiquement. + * Le champ next du dernier maillon vaut (struct maillon_double*)0 + * + * Le champ tete d'une liste pointe vers le premier maillon + * Le champ nbelem est égal au nombre de maillons de la liste + * La liste vide est codée par (tete, nbelem) = ((struct maillon_double*)0, 0) + * + * Des listes distinctes ont des maillons distincts (pas de maillon partagé). + **********************************************************************/ + +struct maillon_double +{ double value; + struct maillon_double* next; +}; + +struct liste_double +{ struct maillon_double* tete; + int nbelem; +}; + +/********************************************************************** + * PROTOTYPES DES FONCTIONS (TYPE ABSTRAIT) + **********************************************************************/ + +/* + * Constructeur. Initialise son paramètre à la liste vide + */ + +extern void init_liste_double (struct liste_double*); + +/* + * Destructeur + */ + +extern void clear_liste_double (struct liste_double*); + +/* + * Affecte une copie de src à dst + */ + +extern void set_liste_double + (struct liste_double* dst, struct liste_double* src); + +/* + * Ajout d'un double en tête de liste + */ + +extern void ajouter_en_tete_liste_double (struct liste_double*, double); + +/* + * Affecte à *d la valeur du premier élément de L et supprime cet élément de L. + * La liste L est supposée non vide. + */ + +extern void extraire_tete_liste_double (double* d, struct liste_double* L); + +/* + * Impression. + */ + +extern void imprimer_liste_double (struct liste_double*); +#endif diff --git a/SD/TP6_Hachage/liste_double/main.c b/SD/TP6_Hachage/liste_double/main.c new file mode 100644 index 0000000..aa72669 --- /dev/null +++ b/SD/TP6_Hachage/liste_double/main.c @@ -0,0 +1,16 @@ +#include "liste_double.h" + +int main () +{ struct liste_double A; + + init_liste_double (&A); + + ajouter_en_tete_liste_double (&A, -0.1); + ajouter_en_tete_liste_double (&A, 0.0); + ajouter_en_tete_liste_double (&A, 3.14); + + imprimer_liste_double (&A); + + clear_liste_double (&A); + return 0; +} diff --git a/SD/TP6_Hachage/main.c b/SD/TP6_Hachage/main.c new file mode 100644 index 0000000..7281dd9 --- /dev/null +++ b/SD/TP6_Hachage/main.c @@ -0,0 +1,24 @@ +/* main.c */ +#include +#include "hachage_simple.h" + +int hachage_basique (double d) +{ + return (int)d % N; +} + +int main () +{ + + struct table T; + double x; + init_table (&T, &hachage_basique); + /*scanf ("%lf", &x); + while (x != -1){ + enregistrer_table (&T, x); + imprimer_table (&T); + scanf ("%lf", &x); + } + clear_table (&T);*/ + return 0; +} diff --git a/SD/TP6_Hachage/main.o b/SD/TP6_Hachage/main.o new file mode 100644 index 0000000..3962819 Binary files /dev/null and b/SD/TP6_Hachage/main.o differ diff --git a/SD/TP6_Hachage/prog b/SD/TP6_Hachage/prog new file mode 100755 index 0000000..e157c2f Binary files /dev/null and b/SD/TP6_Hachage/prog differ diff --git a/TpSD3_Karatsuba/.Karatsuba.c.kate-swp b/TpSD3_Karatsuba/.Karatsuba.c.kate-swp deleted file mode 100644 index 5cc6fa5..0000000 Binary files a/TpSD3_Karatsuba/.Karatsuba.c.kate-swp and /dev/null differ diff --git a/TpSD3_Karatsuba/Elementaire.stats b/TpSD3_Karatsuba/Elementaire.stats deleted file mode 100644 index 7ff5d4c..0000000 --- a/TpSD3_Karatsuba/Elementaire.stats +++ /dev/null @@ -1,600 +0,0 @@ -# n f(n) - 1 2 - 2 11 - 3 33 - 4 46 - 5 94 - 6 120 - 7 150 - 8 167 - 9 267 - 10 319 - 11 375 - 12 405 - 13 469 - 14 503 - 15 541 - 16 562 - 17 766 - 18 870 - 19 978 - 20 1034 - 21 1150 - 22 1210 - 23 1274 - 24 1308 - 25 1440 - 26 1508 - 27 1580 - 28 1618 - 29 1698 - 30 1740 - 31 1786 - 32 1811 - 33 2223 - 34 2431 - 35 2643 - 36 2751 - 37 2971 - 38 3083 - 39 3199 - 40 3259 - 41 3495 - 42 3615 - 43 3739 - 44 3803 - 45 3935 - 46 4003 - 47 4075 - 48 4113 - 49 4381 - 50 4517 - 51 4657 - 52 4729 - 53 4877 - 54 4953 - 55 5033 - 56 5075 - 57 5239 - 58 5323 - 59 5411 - 60 5457 - 61 5553 - 62 5603 - 63 5657 - 64 5686 - 65 6514 - 66 6930 - 67 7350 - 68 7562 - 69 7990 - 70 8206 - 71 8426 - 72 8538 - 73 8982 - 74 9206 - 75 9434 - 76 9550 - 77 9786 - 78 9906 - 79 10030 - 80 10094 - 81 10570 - 82 10810 - 83 11054 - 84 11178 - 85 11430 - 86 11558 - 87 11690 - 88 11758 - 89 12026 - 90 12162 - 91 12302 - 92 12374 - 93 12522 - 94 12598 - 95 12678 - 96 12720 - 97 13260 - 98 13532 - 99 13808 - 100 13948 - 101 14232 - 102 14376 - 103 14524 - 104 14600 - 105 14900 - 106 15052 - 107 15208 - 108 15288 - 109 15452 - 110 15536 - 111 15624 - 112 15670 - 113 16002 - 114 16170 - 115 16342 - 116 16430 - 117 16610 - 118 16702 - 119 16798 - 120 16848 - 121 17044 - 122 17144 - 123 17248 - 124 17302 - 125 17414 - 126 17472 - 127 17534 - 128 17567 - 129 19227 - 130 20059 - 131 20895 - 132 21315 - 133 22159 - 134 22583 - 135 23011 - 136 23227 - 137 24087 - 138 24519 - 139 24955 - 140 25175 - 141 25619 - 142 25843 - 143 26071 - 144 26187 - 145 27079 - 146 27527 - 147 27979 - 148 28207 - 149 28667 - 150 28899 - 151 29135 - 152 29255 - 153 29731 - 154 29971 - 155 30215 - 156 30339 - 157 30591 - 158 30719 - 159 30851 - 160 30919 - 161 31875 - 162 32355 - 163 32839 - 164 33083 - 165 33575 - 166 33823 - 167 34075 - 168 34203 - 169 34711 - 170 34967 - 171 35227 - 172 35359 - 173 35627 - 174 35763 - 175 35903 - 176 35975 - 177 36515 - 178 36787 - 179 37063 - 180 37203 - 181 37487 - 182 37631 - 183 37779 - 184 37855 - 185 38155 - 186 38307 - 187 38463 - 188 38543 - 189 38707 - 190 38791 - 191 38879 - 192 38925 - 193 40009 - 194 40553 - 195 41101 - 196 41377 - 197 41933 - 198 42213 - 199 42497 - 200 42641 - 201 43213 - 202 43501 - 203 43793 - 204 43941 - 205 44241 - 206 44393 - 207 44549 - 208 44629 - 209 45233 - 210 45537 - 211 45845 - 212 46001 - 213 46317 - 214 46477 - 215 46641 - 216 46725 - 217 47057 - 218 47225 - 219 47397 - 220 47485 - 221 47665 - 222 47757 - 223 47853 - 224 47903 - 225 48571 - 226 48907 - 227 49247 - 228 49419 - 229 49767 - 230 49943 - 231 50123 - 232 50215 - 233 50579 - 234 50763 - 235 50951 - 236 51047 - 237 51243 - 238 51343 - 239 51447 - 240 51501 - 241 51897 - 242 52097 - 243 52301 - 244 52405 - 245 52617 - 246 52725 - 247 52837 - 248 52895 - 249 53123 - 250 53239 - 251 53359 - 252 53421 - 253 53549 - 254 53615 - 255 53685 - 256 53722 - 257 57046 - 258 58710 - 259 60378 - 260 61214 - 261 62890 - 262 63730 - 263 64574 - 264 64998 - 265 66690 - 266 67538 - 267 68390 - 268 68818 - 269 69678 - 270 70110 - 271 70546 - 272 70766 - 273 72490 - 274 73354 - 275 74222 - 276 74658 - 277 75534 - 278 75974 - 279 76418 - 280 76642 - 281 77534 - 282 77982 - 283 78434 - 284 78662 - 285 79122 - 286 79354 - 287 79590 - 288 79710 - 289 81498 - 290 82394 - 291 83294 - 292 83746 - 293 84654 - 294 85110 - 295 85570 - 296 85802 - 297 86726 - 298 87190 - 299 87658 - 300 87894 - 301 88370 - 302 88610 - 303 88854 - 304 88978 - 305 89934 - 306 90414 - 307 90898 - 308 91142 - 309 91634 - 310 91882 - 311 92134 - 312 92262 - 313 92770 - 314 93026 - 315 93286 - 316 93418 - 317 93686 - 318 93822 - 319 93962 - 320 94034 - 321 95950 - 322 96910 - 323 97874 - 324 98358 - 325 99330 - 326 99818 - 327 100310 - 328 100558 - 329 101546 - 330 102042 - 331 102542 - 332 102794 - 333 103302 - 334 103558 - 335 103818 - 336 103950 - 337 104970 - 338 105482 - 339 105998 - 340 106258 - 341 106782 - 342 107046 - 343 107314 - 344 107450 - 345 107990 - 346 108262 - 347 108538 - 348 108678 - 349 108962 - 350 109106 - 351 109254 - 352 109330 - 353 110414 - 354 110958 - 355 111506 - 356 111782 - 357 112338 - 358 112618 - 359 112902 - 360 113046 - 361 113618 - 362 113906 - 363 114198 - 364 114346 - 365 114646 - 366 114798 - 367 114954 - 368 115034 - 369 115638 - 370 115942 - 371 116250 - 372 116406 - 373 116722 - 374 116882 - 375 117046 - 376 117130 - 377 117462 - 378 117630 - 379 117802 - 380 117890 - 381 118070 - 382 118162 - 383 118258 - 384 118308 - 385 120480 - 386 121568 - 387 122660 - 388 123208 - 389 124308 - 390 124860 - 391 125416 - 392 125696 - 393 126812 - 394 127372 - 395 127936 - 396 128220 - 397 128792 - 398 129080 - 399 129372 - 400 129520 - 401 130668 - 402 131244 - 403 131824 - 404 132116 - 405 132704 - 406 133000 - 407 133300 - 408 133452 - 409 134056 - 410 134360 - 411 134668 - 412 134824 - 413 135140 - 414 135300 - 415 135464 - 416 135548 - 417 136760 - 418 137368 - 419 137980 - 420 138288 - 421 138908 - 422 139220 - 423 139536 - 424 139696 - 425 140332 - 426 140652 - 427 140976 - 428 141140 - 429 141472 - 430 141640 - 431 141812 - 432 141900 - 433 142568 - 434 142904 - 435 143244 - 436 143416 - 437 143764 - 438 143940 - 439 144120 - 440 144212 - 441 144576 - 442 144760 - 443 144948 - 444 145044 - 445 145240 - 446 145340 - 447 145444 - 448 145498 - 449 146838 - 450 147510 - 451 148186 - 452 148526 - 453 149210 - 454 149554 - 455 149902 - 456 150078 - 457 150778 - 458 151130 - 459 151486 - 460 151666 - 461 152030 - 462 152214 - 463 152402 - 464 152498 - 465 153230 - 466 153598 - 467 153970 - 468 154158 - 469 154538 - 470 154730 - 471 154926 - 472 155026 - 473 155422 - 474 155622 - 475 155826 - 476 155930 - 477 156142 - 478 156250 - 479 156362 - 480 156420 - 481 157216 - 482 157616 - 483 158020 - 484 158224 - 485 158636 - 486 158844 - 487 159056 - 488 159164 - 489 159592 - 490 159808 - 491 160028 - 492 160140 - 493 160368 - 494 160484 - 495 160604 - 496 160666 - 497 161126 - 498 161358 - 499 161594 - 500 161714 - 501 161958 - 502 162082 - 503 162210 - 504 162276 - 505 162536 - 506 162668 - 507 162804 - 508 162874 - 509 163018 - 510 163092 - 511 163170 - 512 163211 - 513 169863 - 514 173191 - 515 176523 - 516 178191 - 517 181531 - 518 183203 - 519 184879 - 520 185719 - 521 189075 - 522 190755 - 523 192439 - 524 193283 - 525 194975 - 526 195823 - 527 196675 - 528 197103 - 529 200491 - 530 202187 - 531 203887 - 532 204739 - 533 206447 - 534 207303 - 535 208163 - 536 208595 - 537 210319 - 538 211183 - 539 212051 - 540 212487 - 541 213363 - 542 213803 - 543 214247 - 544 214471 - 545 217923 - 546 219651 - 547 221383 - 548 222251 - 549 223991 - 550 224863 - 551 225739 - 552 226179 - 553 227935 - 554 228815 - 555 229699 - 556 230143 - 557 231035 - 558 231483 - 559 231935 - 560 232163 - 561 233951 - 562 234847 - 563 235747 - 564 236199 - 565 237107 - 566 237563 - 567 238023 - 568 238255 - 569 239179 - 570 239643 - 571 240111 - 572 240347 - 573 240823 - 574 241063 - 575 241307 - 576 241431 - 577 245011 - 578 246803 - 579 248599 - 580 249499 - 581 251303 - 582 252207 - 583 253115 - 584 253571 - 585 255391 - 586 256303 - 587 257219 - 588 257679 - 589 258603 - 590 259067 - 591 259535 - 592 259771 - 593 261623 - 594 262551 - 595 263483 - 596 263951 - 597 264891 - 598 265363 - 599 265839 diff --git a/TpSD3_Karatsuba/Karatsuba.c b/TpSD3_Karatsuba/Karatsuba.c deleted file mode 100644 index e858d7b..0000000 --- a/TpSD3_Karatsuba/Karatsuba.c +++ /dev/null @@ -1,258 +0,0 @@ -#include -#include -#include -#include -#include - -/* - * Représentation élémentaire d'un polynôme. - * On pourrait, au minimum, rajouter le degré ! - */ - -struct poly -{ double* T; /* le tableau des coefficients */ - bool dynamic; /* indique si T a été alloué dynamiquement */ - int n; /* la taille du tableau */ -}; - -/* - * Constructeur. Le tableau T est alloué dynamiquement - */ -void init_poly (struct poly* A, int n) -{ - A->T = (double*)malloc (n * sizeof (double)); - assert (A->T != (double*)0); - A->n = n; - A->dynamic = true; -} - -/* - * Autre constructeur. Le tableau T est passé en paramètre. - * Il n'est donc pas alloué dynamiquement - */ -void init2_poly (struct poly* A, double* T, int n) -{ - A->T = T; - A->n = n; - A->dynamic = false; -} - -/* - * Destructeur. - */ -void clear_poly (struct poly* A) -{ - if (A->dynamic) - free (A->T); -} - -/* - * L'impression d'un polynôme est plus technique qu'on ne le croit :-) - * On suppose que les doubles sont en fait des entiers - */ -void print_poly (struct poly* A) -{ long c; - int i; - bool b; - - b = false; - for (i = A->n - 1; i >= 0; i--) - { if (A->T[i] != 0.0) - { if (A->T[i] > 0) - { if (b) printf (" + "); - } else - { if (b) printf (" - "); else printf ("-"); - } - b = true; - if (A->T[i] > 0) c = (long)A->T[i]; else c = (long) - A->T[i]; - if (i == 0) - printf ("%ld", c); - else if (i == 1) - { if (c != 1) printf ("%ld*x", c); else printf ("x"); - } else - { if (c != 1) printf ("%ld*x^%d", c, i); else printf ("x^%d", i); - } - } - } - printf ("\n"); -} - -/* - * R = A + B - */ -int add_poly (struct poly* R, struct poly* A, struct poly* B) -{ - int nbOpe=0; - int i; - i = 0; - while (i < A->n && i < B->n) - { R->T[i] = A->T[i] + B->T[i]; - i += 1; - nbOpe+=1; - } - while (i < A->n) - { R->T[i] = A->T[i]; - i += 1; - } - while (i < B->n) - { R->T[i] = B->T[i]; - i += 1; - } - while (i < R->n) - { R->T[i] = 0.0; - i += 1; - } - return nbOpe; -} - -/* - * R = A - B - */ -int sub_poly (struct poly* R, struct poly* A, struct poly* B) -{ - int nbOpe=0; - int i; - i = 0; - while (i < A->n && i < B->n) - { R->T[i] = A->T[i] - B->T[i]; - i += 1; - nbOpe+=1; - } - while (i < A->n) - { R->T[i] = A->T[i]; - i += 1; - } - while (i < B->n) - { R->T[i] = - B->T[i]; - i += 1; - } - while (i < R->n) - { R->T[i] = 0.0; - i += 1; - } - return nbOpe; -} - -/* - * R = A * B par la méthode élémentaire - */ -int mul_poly (struct poly* R, struct poly* A, struct poly* B) -{ - int nbOpe=0; - int a, b; - for (a = 0; a < R->n; a++) - R->T[a] = 0.0; - for (a = 0; a < A->n; a++){ - for (b = 0; b < B->n; b++){ - R->T[a+b] = R->T[a+b] + A->T[a] * B->T[b]; - nbOpe+=2; - } - } - return nbOpe; -} - -/* - * R = A * B par la méthode de Karatsuba - */ -int Karatsuba (struct poly* R, struct poly* A, struct poly* B) -{ struct poly R0, R1, R2, A0, A1, B0, B1, tmpA, tmpB; - int i, p, q; - int nbOpe =0; - -/* - * L'algorithme élémentaire est utilisé pour les cas de base - */ - if (A->n == 1 || B->n == 1) - nbOpe+=mul_poly (R, A, B); - else - { - if (A->n < B->n) - p = A->n/2; - else - p = B->n/2; -/* - * Découper les polynômes A et B en deux se fait en temps constant - */ - init2_poly (&A0, A->T, p); - init2_poly (&A1, A->T + p, A->n - p); - init2_poly (&B0, B->T, p); - init2_poly (&B1, B->T + p, B->n - p); -/* - * Les polynômes R0 et R2 sont des sous-tableaux de R. - * On évite ainsi deux recopies de tableaux. - */ - init2_poly (&R0, R->T, 2*p-1); - init2_poly (&R2, R->T + 2*p, A->n + B->n - 1 - 2*p); - nbOpe+=Karatsuba (&R0, &A0, &B0); - nbOpe+=Karatsuba (&R2, &A1, &B1); -/* - * À ce stade, R = R0 + x^(2*p)*R2. On calcule maintenant R1. - */ - if (A0.n > A1.n) q = A0.n; else q = A1.n; - init_poly (&tmpA, q); - nbOpe+= add_poly (&tmpA, &A0, &A1); - if (B0.n > B1.n) q = B0.n; else q = B1.n; - init_poly (&tmpB, q); - nbOpe+=add_poly (&tmpB, &B0, &B1); - q = tmpA.n + tmpB.n - 1; - if (q < R0.n) q = R0.n; - if (q < R2.n) q = R2.n; - init_poly (&R1, q); - nbOpe+= Karatsuba (&R1, &tmpA, &tmpB); - nbOpe+= sub_poly (&R1, &R1, &R0); - nbOpe+= sub_poly (&R1, &R1, &R2); -/* - * R = R + x^p*R1 - */ - R->T[2*p-1] = 0; - for (i = 0; i < R1.n; i++){ - R->T[p+i] = R->T[p+i] + R1.T[i]; - nbOpe++; - } - - clear_poly (&A0); - clear_poly (&A1); - clear_poly (&B0); - clear_poly (&B1); - clear_poly (&R0); - clear_poly (&R1); - clear_poly (&R2); - clear_poly (&tmpA); - clear_poly (&tmpB); - } - return nbOpe; -} - -int main () -{ struct poly A, B, R; - int i, n, N; - int nbOpe =0; - int nbNumPoly=0; - srand48 ((long)421); - - N = 600; /* taille des polynômes */ - init_poly (&A, N); - init_poly (&B, N); - init_poly (&R, 2*N-1); - for (i = 0; i < N; i++) - { - A.T [i] = floor (10.0 * drand48 () - 5.0); - B.T [i] = floor (10.0 * drand48 () - 5.0); - } - printf("#\tn\tf(n)\n"); - for (n = 1; n < N; n++) - { - nbOpe=0; - nbNumPoly=0; - A.n = n; - B.n = n; - nbNumPoly=mul_poly (&R, &A, &B); - //print_poly (&R); - nbOpe=Karatsuba (&R, &A, &B); - //print_poly (&R); - // printf("\t%d\t%d",n, nbNumPoly); - printf("\t%d\t%d\n",n, nbOpe); - - } - -} diff --git a/TpSD3_Karatsuba/Karatsuba.stats b/TpSD3_Karatsuba/Karatsuba.stats deleted file mode 100644 index 7ff5d4c..0000000 --- a/TpSD3_Karatsuba/Karatsuba.stats +++ /dev/null @@ -1,600 +0,0 @@ -# n f(n) - 1 2 - 2 11 - 3 33 - 4 46 - 5 94 - 6 120 - 7 150 - 8 167 - 9 267 - 10 319 - 11 375 - 12 405 - 13 469 - 14 503 - 15 541 - 16 562 - 17 766 - 18 870 - 19 978 - 20 1034 - 21 1150 - 22 1210 - 23 1274 - 24 1308 - 25 1440 - 26 1508 - 27 1580 - 28 1618 - 29 1698 - 30 1740 - 31 1786 - 32 1811 - 33 2223 - 34 2431 - 35 2643 - 36 2751 - 37 2971 - 38 3083 - 39 3199 - 40 3259 - 41 3495 - 42 3615 - 43 3739 - 44 3803 - 45 3935 - 46 4003 - 47 4075 - 48 4113 - 49 4381 - 50 4517 - 51 4657 - 52 4729 - 53 4877 - 54 4953 - 55 5033 - 56 5075 - 57 5239 - 58 5323 - 59 5411 - 60 5457 - 61 5553 - 62 5603 - 63 5657 - 64 5686 - 65 6514 - 66 6930 - 67 7350 - 68 7562 - 69 7990 - 70 8206 - 71 8426 - 72 8538 - 73 8982 - 74 9206 - 75 9434 - 76 9550 - 77 9786 - 78 9906 - 79 10030 - 80 10094 - 81 10570 - 82 10810 - 83 11054 - 84 11178 - 85 11430 - 86 11558 - 87 11690 - 88 11758 - 89 12026 - 90 12162 - 91 12302 - 92 12374 - 93 12522 - 94 12598 - 95 12678 - 96 12720 - 97 13260 - 98 13532 - 99 13808 - 100 13948 - 101 14232 - 102 14376 - 103 14524 - 104 14600 - 105 14900 - 106 15052 - 107 15208 - 108 15288 - 109 15452 - 110 15536 - 111 15624 - 112 15670 - 113 16002 - 114 16170 - 115 16342 - 116 16430 - 117 16610 - 118 16702 - 119 16798 - 120 16848 - 121 17044 - 122 17144 - 123 17248 - 124 17302 - 125 17414 - 126 17472 - 127 17534 - 128 17567 - 129 19227 - 130 20059 - 131 20895 - 132 21315 - 133 22159 - 134 22583 - 135 23011 - 136 23227 - 137 24087 - 138 24519 - 139 24955 - 140 25175 - 141 25619 - 142 25843 - 143 26071 - 144 26187 - 145 27079 - 146 27527 - 147 27979 - 148 28207 - 149 28667 - 150 28899 - 151 29135 - 152 29255 - 153 29731 - 154 29971 - 155 30215 - 156 30339 - 157 30591 - 158 30719 - 159 30851 - 160 30919 - 161 31875 - 162 32355 - 163 32839 - 164 33083 - 165 33575 - 166 33823 - 167 34075 - 168 34203 - 169 34711 - 170 34967 - 171 35227 - 172 35359 - 173 35627 - 174 35763 - 175 35903 - 176 35975 - 177 36515 - 178 36787 - 179 37063 - 180 37203 - 181 37487 - 182 37631 - 183 37779 - 184 37855 - 185 38155 - 186 38307 - 187 38463 - 188 38543 - 189 38707 - 190 38791 - 191 38879 - 192 38925 - 193 40009 - 194 40553 - 195 41101 - 196 41377 - 197 41933 - 198 42213 - 199 42497 - 200 42641 - 201 43213 - 202 43501 - 203 43793 - 204 43941 - 205 44241 - 206 44393 - 207 44549 - 208 44629 - 209 45233 - 210 45537 - 211 45845 - 212 46001 - 213 46317 - 214 46477 - 215 46641 - 216 46725 - 217 47057 - 218 47225 - 219 47397 - 220 47485 - 221 47665 - 222 47757 - 223 47853 - 224 47903 - 225 48571 - 226 48907 - 227 49247 - 228 49419 - 229 49767 - 230 49943 - 231 50123 - 232 50215 - 233 50579 - 234 50763 - 235 50951 - 236 51047 - 237 51243 - 238 51343 - 239 51447 - 240 51501 - 241 51897 - 242 52097 - 243 52301 - 244 52405 - 245 52617 - 246 52725 - 247 52837 - 248 52895 - 249 53123 - 250 53239 - 251 53359 - 252 53421 - 253 53549 - 254 53615 - 255 53685 - 256 53722 - 257 57046 - 258 58710 - 259 60378 - 260 61214 - 261 62890 - 262 63730 - 263 64574 - 264 64998 - 265 66690 - 266 67538 - 267 68390 - 268 68818 - 269 69678 - 270 70110 - 271 70546 - 272 70766 - 273 72490 - 274 73354 - 275 74222 - 276 74658 - 277 75534 - 278 75974 - 279 76418 - 280 76642 - 281 77534 - 282 77982 - 283 78434 - 284 78662 - 285 79122 - 286 79354 - 287 79590 - 288 79710 - 289 81498 - 290 82394 - 291 83294 - 292 83746 - 293 84654 - 294 85110 - 295 85570 - 296 85802 - 297 86726 - 298 87190 - 299 87658 - 300 87894 - 301 88370 - 302 88610 - 303 88854 - 304 88978 - 305 89934 - 306 90414 - 307 90898 - 308 91142 - 309 91634 - 310 91882 - 311 92134 - 312 92262 - 313 92770 - 314 93026 - 315 93286 - 316 93418 - 317 93686 - 318 93822 - 319 93962 - 320 94034 - 321 95950 - 322 96910 - 323 97874 - 324 98358 - 325 99330 - 326 99818 - 327 100310 - 328 100558 - 329 101546 - 330 102042 - 331 102542 - 332 102794 - 333 103302 - 334 103558 - 335 103818 - 336 103950 - 337 104970 - 338 105482 - 339 105998 - 340 106258 - 341 106782 - 342 107046 - 343 107314 - 344 107450 - 345 107990 - 346 108262 - 347 108538 - 348 108678 - 349 108962 - 350 109106 - 351 109254 - 352 109330 - 353 110414 - 354 110958 - 355 111506 - 356 111782 - 357 112338 - 358 112618 - 359 112902 - 360 113046 - 361 113618 - 362 113906 - 363 114198 - 364 114346 - 365 114646 - 366 114798 - 367 114954 - 368 115034 - 369 115638 - 370 115942 - 371 116250 - 372 116406 - 373 116722 - 374 116882 - 375 117046 - 376 117130 - 377 117462 - 378 117630 - 379 117802 - 380 117890 - 381 118070 - 382 118162 - 383 118258 - 384 118308 - 385 120480 - 386 121568 - 387 122660 - 388 123208 - 389 124308 - 390 124860 - 391 125416 - 392 125696 - 393 126812 - 394 127372 - 395 127936 - 396 128220 - 397 128792 - 398 129080 - 399 129372 - 400 129520 - 401 130668 - 402 131244 - 403 131824 - 404 132116 - 405 132704 - 406 133000 - 407 133300 - 408 133452 - 409 134056 - 410 134360 - 411 134668 - 412 134824 - 413 135140 - 414 135300 - 415 135464 - 416 135548 - 417 136760 - 418 137368 - 419 137980 - 420 138288 - 421 138908 - 422 139220 - 423 139536 - 424 139696 - 425 140332 - 426 140652 - 427 140976 - 428 141140 - 429 141472 - 430 141640 - 431 141812 - 432 141900 - 433 142568 - 434 142904 - 435 143244 - 436 143416 - 437 143764 - 438 143940 - 439 144120 - 440 144212 - 441 144576 - 442 144760 - 443 144948 - 444 145044 - 445 145240 - 446 145340 - 447 145444 - 448 145498 - 449 146838 - 450 147510 - 451 148186 - 452 148526 - 453 149210 - 454 149554 - 455 149902 - 456 150078 - 457 150778 - 458 151130 - 459 151486 - 460 151666 - 461 152030 - 462 152214 - 463 152402 - 464 152498 - 465 153230 - 466 153598 - 467 153970 - 468 154158 - 469 154538 - 470 154730 - 471 154926 - 472 155026 - 473 155422 - 474 155622 - 475 155826 - 476 155930 - 477 156142 - 478 156250 - 479 156362 - 480 156420 - 481 157216 - 482 157616 - 483 158020 - 484 158224 - 485 158636 - 486 158844 - 487 159056 - 488 159164 - 489 159592 - 490 159808 - 491 160028 - 492 160140 - 493 160368 - 494 160484 - 495 160604 - 496 160666 - 497 161126 - 498 161358 - 499 161594 - 500 161714 - 501 161958 - 502 162082 - 503 162210 - 504 162276 - 505 162536 - 506 162668 - 507 162804 - 508 162874 - 509 163018 - 510 163092 - 511 163170 - 512 163211 - 513 169863 - 514 173191 - 515 176523 - 516 178191 - 517 181531 - 518 183203 - 519 184879 - 520 185719 - 521 189075 - 522 190755 - 523 192439 - 524 193283 - 525 194975 - 526 195823 - 527 196675 - 528 197103 - 529 200491 - 530 202187 - 531 203887 - 532 204739 - 533 206447 - 534 207303 - 535 208163 - 536 208595 - 537 210319 - 538 211183 - 539 212051 - 540 212487 - 541 213363 - 542 213803 - 543 214247 - 544 214471 - 545 217923 - 546 219651 - 547 221383 - 548 222251 - 549 223991 - 550 224863 - 551 225739 - 552 226179 - 553 227935 - 554 228815 - 555 229699 - 556 230143 - 557 231035 - 558 231483 - 559 231935 - 560 232163 - 561 233951 - 562 234847 - 563 235747 - 564 236199 - 565 237107 - 566 237563 - 567 238023 - 568 238255 - 569 239179 - 570 239643 - 571 240111 - 572 240347 - 573 240823 - 574 241063 - 575 241307 - 576 241431 - 577 245011 - 578 246803 - 579 248599 - 580 249499 - 581 251303 - 582 252207 - 583 253115 - 584 253571 - 585 255391 - 586 256303 - 587 257219 - 588 257679 - 589 258603 - 590 259067 - 591 259535 - 592 259771 - 593 261623 - 594 262551 - 595 263483 - 596 263951 - 597 264891 - 598 265363 - 599 265839 diff --git a/TpSD3_Karatsuba/a.out b/TpSD3_Karatsuba/a.out deleted file mode 100755 index 2ab21d9..0000000 Binary files a/TpSD3_Karatsuba/a.out and /dev/null differ diff --git a/arbres.tgz b/arbres.tgz new file mode 100644 index 0000000..da13ce8 Binary files /dev/null and b/arbres.tgz differ -- libgit2 0.21.2