Solved

In the Following Code, What Is the Algorithm's Complexity? MinIndex

Question 23

Multiple Choice

In the following code, what is the algorithm's complexity? minIndex = 0
CurrentIndex = 1
While currentIndex < len(lyst) :
If lyst[currentIndex] < lyst[minIndex]:
MinIndex = currentIndex
CurrentIndex += 1
Return minIndex


A) O( n 2)
B) O( n )
C) O(log2 n )
D) O2

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions