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...

MasterCard and VISA developed ____ in 1997.

A. Secure Hypertext Transfer Protocol (SHTTP) B. Secure Shell (SSH) C. Secure Sockets Layer (SSL) D. Secure Electronic Transactions (SET)

Computer Science & Information Technology

A(n) ________ app is a Windows app that uses a common code base to deliver the app to any Windows device

Fill in the blank(s) with correct word

Computer Science & Information Technology

When usingdl, ____ indicates the description.

A. dt B. dd C. di D. ds

Computer Science & Information Technology

In order to convert a basic disk to a dynamic disk, how much free space must be available on the disk?

A. 512K B. 1MB C. 10MB D. 128MB

Computer Science & Information Technology