Compare commits

1 Commits
main ... main

Author SHA1 Message Date
Aissi Jude Christ
0cd6879290 Exo 3 à finir 2025-10-15 12:59:56 +02:00
3 changed files with 45 additions and 0 deletions

16
Exercice2.md Normal file
View File

@@ -0,0 +1,16 @@
**Calculs de complecité de fonctions**
- Function_1
- Complexité = 1
- O(n×m)
- Function_2
- Complexité = 1
- O(n)
- Function_3
- Complexité = 1
- O(n)

0
Exercice3.md Normal file
View File

29
fonctions.py Normal file
View File

@@ -0,0 +1,29 @@
def function(tableau1, tableau2):
presentDansDeuxListes = 0
for nombre1 in tableau1:
for (nombre2 in tableau2):
if (nombre1 == nombre2):
presentDansDeuxListes += 1
break
return presentDansDeuxListes
def funtion_2(x):
valeur = 0
while (x > 0):
valeur = valeur + x
x -= 1
return valeur
def function_3(x):
valeur = 0
if (x < 0):
valeur = -x
if (x == 0):
pass
if (x > 0):
valeur = x
return valeur