为什么时间复杂度为O(1)pow(x,y)而O(n)为x ** y?
pow(x,y)
x ** y
在这里查看来自agf的 评论
python asymptotic-complexity
注意:我确实在SO上进行搜索,但是只能找到与打印第n个斐波那契数有关的问题。例如斐波那契数,在Python 3中有一个内衬?
python lambda python-2.7 python-3.x
python ×2
asymptotic-complexity ×1
lambda ×1
python-2.7 ×1
python-3.x ×1