小编use*_*721的帖子

计数功能的运行时复杂性

def findTarget(myList, target):

    count = 0

    for item in myList:

         if (target == item):

              count = count + 1

    return count
Run Code Online (Sandbox Code Playgroud)

有人告诉我这是0(log)n虽然我相信这是0(1)?有人可以确认还是否认?

python complexity-theory list

0
推荐指数
1
解决办法
1604
查看次数

标签 统计

complexity-theory ×1

list ×1

python ×1