logo

Crowdly

Browser

Додати до Chrome

Computer Science / Rekenaarwetenskap - 144

Шукаєте відповіді та рішення тестів для Computer Science / Rekenaarwetenskap - 144? Перегляньте нашу велику колекцію перевірених відповідей для Computer Science / Rekenaarwetenskap - 144 в stemlearn.sun.ac.za.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

This double loop fills an n-by-n matrix. Its running time as a function of n is:

for i in range(n):

for j in range(n):

c[i][j] = 1.0 if i == j else 0.0

0%
0%
100%
0%
Переглянути це питання

Towers of Hanoi and 'print all subsets of n elements' both run in time proportional to 2ⁿ. This order of growth is called:

0%
0%
100%
0%
Переглянути це питання

Why does concatenating a single character onto a string take time proportional to the string's current length (not constant time)?

100%
0%
0%
0%
Переглянути це питання

Insertion sort takes about 8 seconds to sort 10 000 random ints. Using its order of growth, roughly how long to sort 20 000 random ints?

0%
0%
0%
100%
Переглянути це питання

n items are added to an empty list. Loop L uses a.insert(0, x) each time; loop R uses a.append(x) each time. Which loop is quadratic?

100%
0%
0%
0%
Переглянути це питання

Scanning a sorted array from the front (brute-force linear search) to find a random PRESENT key uses, on average, about:

100%
0%
0%
0%
Переглянути це питання

Why does the text prefer tilde (~) / order-of-growth notation over big-O for PREDICTING performance?

0%
0%
100%
0%
Переглянути це питання

Compared with insertion sort, mergesort (as in merge.py) needs:

0%
100%
0%
0%
Переглянути це питання

Insertion sort does the MOST work (about n²/2 compares) on which input?

100%
0%
0%
0%
Переглянути це питання

Consider building a reversed copy of a string s of length n. Because strings are immutable, the running time is:

reverse = ''

for i in range(n):

reverse = s[i] + reverse

0%
100%
0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на stemlearn.sun.ac.za?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome