✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Оцените временную и пространственную сложность привденного фрагмента кода:
CPP:
int a = 0, b = 0;
for (i = 0; i < N; i++) {
a = a + rand();
}
for (j = 0; j < M; j++) {
b = b + rand();
}
Python:
a = 0
b = 0
for i in range(N):
a = a + random()
for i in range(M):
b= b + random()