Skip to content
Snippets Groups Projects
Verified Commit f528f50e authored by orestis.malaspin's avatar orestis.malaspin
Browse files

typos

parent b4e32670
No related branches found
No related tags found
No related merge requests found
...@@ -153,13 +153,17 @@ int pow(int x, int n) { ...@@ -153,13 +153,17 @@ int pow(int x, int n) {
return 1; return 1;
} }
for (int i = 1; i < n; ++i) { for (int i = 1; i < n; ++i) {
x *= x; x = x * x; // x *= x
} }
return x; return x;
} }
``` ```
* Complexité? Combien de multiplication en fonction de `n`? * Combien de multiplication et d'assignations en fonction de `n`?
. . .
* `n` assignations et `n` multiplications.
# Exponentiation rapide ou indienne (2/4) # Exponentiation rapide ou indienne (2/4)
...@@ -233,8 +237,7 @@ Comment mesurer l'efficacité d'un algorithme? ...@@ -233,8 +237,7 @@ Comment mesurer l'efficacité d'un algorithme?
. . . . . .
Dépendant du **matériel**, du **compilateur**, des **options de compilation**, Dépendant du **matériel**, du **compilateur**, des **options de compilation**, etc!
etc!
## Mesure du temps CPU ## Mesure du temps CPU
...@@ -436,7 +439,7 @@ $$ ...@@ -436,7 +439,7 @@ $$
## Complexité de trouver le minimum d'un tableau? ## Complexité de trouver le minimum d'un tableau?
```C ```C
min = MAX; int min = MAX;
for (i = 0; i < N; ++i) { for (i = 0; i < N; ++i) {
if (tab[i] < min) { if (tab[i] < min) {
min = tab[i]; min = tab[i];
...@@ -458,7 +461,7 @@ $$ ...@@ -458,7 +461,7 @@ $$
## Complexité du tri par sélection? ## Complexité du tri par sélection?
```C ```C
ind = 0 int ind = 0
while (ind < SIZE-1) { while (ind < SIZE-1) {
min = find_min(tab[ind:SIZE]); min = find_min(tab[ind:SIZE]);
swap(min, tab[ind]); swap(min, tab[ind]);
......
...@@ -2,3 +2,7 @@ bin_tree.o ...@@ -2,3 +2,7 @@ bin_tree.o
avl.o avl.o
main main
main.o main.o
bin_tree.o
avl.o
main
main.o
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment