👤

Para los siguiente fragmentos de código algunos en Java y otros en Python halle su
complejidad:
a) int function1( int n) {
int i, j, k;
int x = 0;
for ( i =1; i <= n; i++)
for ( j =1; j <= n; j++)
for (k = 1; k <= n; k++)
x = x + 1;
return x;
b) def function2 (n) :
x = 0
if n % 2 == 0 :
for i in range(1,n+1) :
x = x + 1;
return x
c) int function3 (int n) {
int i = 1;
int x = 0;
while ( i <= n) {
x = x + 1;
i = i + 2;
}
return x;
}
d) def function4 (n) :
x = 1;
while ( x < n ) :
x = 2 * x;
return x


Para Los Siguiente Fragmentos De Código Algunos En Java Y Otros En Python Halle Su Complejidad A Int Function1 Int N Int I J K Int X 0 For I 1 I Lt N I For J 1 class=