Why is a list access O(1) in Python?

前端 未结 4 787
余生分开走
余生分开走 2021-02-08 16:05

I understand that a list is different from an array. But still, O(1)? That would mean accessing an element in a list would be as fast as accessing an element in a dict, which we

4条回答
  •  你的背包
    2021-02-08 16:42

    The minimum possible I can see is O(log n) from a strict computer science standpoint

提交回复
热议问题