forked from abraham/2026_TD3_DEV51_Qualite_Algo
prepare le merge
This commit is contained in:
+2
-2
@@ -84,11 +84,11 @@ La complexité de la fonction est de <span style="color:blue">[O(n)]</span> pour
|
|||||||
|
|
||||||
# 4. Optimisation
|
# 4. Optimisation
|
||||||
|
|
||||||
- Optimisation de la fonction 1 nom du commit : ""
|
- Optimisation de la fonction 1 nom du commit : "EXO 4 - optimisation F1". Emprunte : ff68d260a7a58441
|
||||||
|
|
||||||
- Optimisation de la fonction 2 nom du commit : "fonction 2 : O(n + C)". Emprunte : ff68d260a7a58441
|
- Optimisation de la fonction 2 nom du commit : "fonction 2 : O(n + C)". Emprunte : ff68d260a7a58441
|
||||||
|
|
||||||
- Optimisation de la fonction 3 nom du commit : "". Emprunte : ff68d260a7a58441
|
- Optimisation de la fonction 3 nom du commit : "EXO 4 - optimisation F3". Emprunte : ff68d260a7a58441
|
||||||
|
|
||||||
- Optimisation de la fonction 4 nom du commit : "fonction 4 : O(n + J)". Emprunte : ff68d260a7a58441
|
- Optimisation de la fonction 4 nom du commit : "fonction 4 : O(n + J)". Emprunte : ff68d260a7a58441
|
||||||
|
|
||||||
|
|||||||
@@ -146,11 +146,12 @@ long meilleure_periode(const long *totaux, int nb_jours, int *debut, int *fin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* F6 : retrouve une transaction à partir de son id */
|
/* F6 : retrouve une transaction à partir de son id */
|
||||||
const Transaction *rechercher_par_id(const Transaction *t, const int *indices_par_id, int n, int id)
|
const Transaction *rechercher_par_id(const Transaction *t, int n, int id)
|
||||||
{
|
{
|
||||||
if (id < 0 || id >= n)
|
for (int i = 0; i < n; i++)
|
||||||
|
if (t[i].id == id)
|
||||||
|
return &t[i];
|
||||||
return NULL;
|
return NULL;
|
||||||
return &t[indices_par_id[id]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* F7 : nombre de paires de transactions de montants opposés (a + b = 0) */
|
/* F7 : nombre de paires de transactions de montants opposés (a + b = 0) */
|
||||||
|
|||||||
Reference in New Issue
Block a user