In the following code, what is the algorithm's complexity?
?
minIndex = 0currentIndex = 1

while currentIndex < len(lyst): if lyst[currentIndex] < lyst[minIndex]: minIndex = currentIndex currentIndex += 1return minIndex
?

A. O(n2)
B. O(n)
C. O(log2n)
D. O2


Answer: B

Computer Science & Information Technology

You might also like to view...

Discuss the advantages of using VBA instead of macros to perform specific operations in Access.

What will be an ideal response?

Computer Science & Information Technology

____ a color ensures that you will match the color without having to enter color values or make selections in other dialog boxes or panels.

a. Resolving b. Cloning c. Reprinting d. Sampling

Computer Science & Information Technology

Cells changed by other users appear in different fonts.? _____________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

IT professionals generally work ________ hours per week and on-call than people in other professions.

A. significantly fewer B. significantly more C. about the same D. exactly the same

Computer Science & Information Technology