Question: Explain if the runtime of the function below is O(len(L)) def isPath(A,L): for i in range(len(L)-1): if A[L[i]][L[i+1]] == 0: return False return True
Explain if the runtime of the function below is O(len(L))
def isPath(A,L):
for i in range(len(L)-1):
if A[L[i]][L[i+1]] == 0:
return False
return True
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
