def findTarget(myList, target):
count = 0
for item in myList:
if (target == item):
count = count + 1
return count
有人告诉我这是 0(log)n 虽然我相信这是 0(1) ?有人可以确认或否认吗?
def findTarget(myList, target):
count = 0
for item in myList:
if (target == item):
count = count + 1
return count
有人告诉我这是 0(log)n 虽然我相信这是 0(1) ?有人可以确认或否认吗?