salut
j'ai un probleme de calculer la complexité d'un algorithme qui fait l'intersection de deux tableaux
s'il vous plait j'ai besoin d'aide
voila le code
Code c : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 while (i1<n1 && i1<n2 && t1[i1]>t2 [n2-1]||t2[i2]>t1[n1-1] { while (i1<n1&&t1[i1]<t2[i2]) i1++; if (i1<n1 &&t1[i1]==t2[i2]) { t[k]=t1[i1]; k++; i1++; } i2++; while (i2<n2&&t2[i2]<t1[i1]) i2++; if (i2<n2 && t2[i2]==t1[i1]) { i2++; t[k]=t1[i1]; k++; } i1++;
Partager