logo

Crowdly

Browser

Add to Chrome

Основы алгоритмизации и программирования

Looking for Основы алгоритмизации и программирования test answers and solutions? Browse our comprehensive collection of verified answers for Основы алгоритмизации и программирования at moodle.siriusuniversity.ru.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Оцените временную и пространственную сложность привденного фрагмента кода:

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()

View this question

Оцените временную сложность приведенного фрагмента кода:

i = 1

while i < n:

i += 1

i *= k

View this question

Оцените временную сложность привденного фрагмента кода:

CPP:

int i, j, k = 0;

for (i = n / 2; i <= n; i++) {

for (j = 2; j <= n; j = j * 2) {

k = k + n / 2;

}

}

View this question

Оцените временную сложность привденного фрагмента кода:

CPP:

int a = 0;

for (i = 0; i < N; i++) {

for (j = N; j > i; j--) {

a = a + i + j;

}

}

Python:

a = 0

for i in range(N):

for j in reversed(range(i,N)):

a = a + i + j

View this question

Оцените временную сложность привденного фрагмента кода:

CPP:

int i, j, k = 0;

int a = 0, i = N;

while (i > 0) {

a += i;

i /= 2;

}

Python:

a = 0

i = N

while (i > 0):

a += i

i //= 2

View this question

Want instant access to all verified answers on moodle.siriusuniversity.ru?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome